[CFE] Auto-add coverage-ignore comments
This pushes coverage to 100%.
Change-Id: I0d5656698fffa4da4cb097b207e786ae997c21a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373662
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/api_prototype/compiler_options.dart b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
index 27a7656..71901bf 100644
--- a/pkg/front_end/lib/src/api_prototype/compiler_options.dart
+++ b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
@@ -299,6 +299,7 @@
/// launched again.
Set<Uri> runningPrecompilations = {};
+ // Coverage-ignore(suite): Not run.
/// Returns the minimum language version needed for a library with the given
/// [importUri] to opt into the experiment with the given [flag].
///
@@ -328,6 +329,7 @@
experimentReleasedVersionForTesting);
}
+ // Coverage-ignore(suite): Not run.
bool equivalent(CompilerOptions other,
{bool ignoreOnDiagnostic = true,
bool ignoreVerbose = true,
@@ -406,6 +408,7 @@
for (String argument in arguments) {
for (String feature in argument.split(',')) {
if (feature.startsWith('no-')) {
+ // Coverage-ignore-block(suite): Not run.
result[feature.substring(3)] = false;
} else {
result[feature] = true;
@@ -437,14 +440,17 @@
bool value = experiments[experiment]!;
ExperimentalFlag? flag = parseExperimentalFlag(experiment);
if (flag == null) {
+ // Coverage-ignore-block(suite): Not run.
onError("Unknown experiment: " + experiment);
} else if (flags.containsKey(flag)) {
+ // Coverage-ignore-block(suite): Not run.
if (flags[flag] != value) {
onError(
"Experiment specified with conflicting values: " + experiment);
}
} else {
if (flag.isExpired) {
+ // Coverage-ignore-block(suite): Not run.
if (value != flag.isEnabledByDefault) {
/// Produce an error when the value is not the default value.
if (value) {
@@ -505,6 +511,7 @@
Set<InvocationMode> result = {};
for (String name in arg.split(',')) {
if (name.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
InvocationMode? mode = fromName(name);
if (mode == null) {
String message = "Unknown invocation mode '$name'.";
@@ -521,6 +528,7 @@
return result;
}
+ // Coverage-ignore(suite): Not run.
/// Returns the [InvocationMode] with the given [name].
static InvocationMode? fromName(String name) {
for (InvocationMode invocationMode in values) {
@@ -553,10 +561,12 @@
static const List<Verbosity> values = const [error, warning, info, all];
+ // Coverage-ignore(suite): Not run.
/// Returns the names of all options.
static List<String> get allowedValues =>
[for (Verbosity value in values) value.name];
+ // Coverage-ignore(suite): Not run.
/// Returns a map from option name to option help messages.
static Map<String, String> get allowedValuesHelp =>
{for (Verbosity value in values) value.name: value.help};
@@ -576,6 +586,7 @@
return verbosity;
}
}
+ // Coverage-ignore-block(suite): Not run.
String message = "Unknown verbosity '$name'.";
if (onError != null) {
onError(message);
@@ -584,6 +595,7 @@
throw new UnsupportedError(message);
}
+ // Coverage-ignore(suite): Not run.
static bool shouldPrint(Verbosity verbosity, DiagnosticMessage message) {
Severity severity = message.severity;
switch (verbosity) {
@@ -638,6 +650,7 @@
String toString() => 'Verbosity($name)';
}
+// Coverage-ignore(suite): Not run.
/// Interface for hooking into the compilation pipeline for testing.
class HooksForTesting {
/// Called before the intermediate macro augmentation libraries have been
diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
index 69b8478..62728dd 100644
--- a/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
+++ b/pkg/front_end/lib/src/api_prototype/experimental_flags.dart
@@ -58,6 +58,7 @@
enabled = explicitExperimentalFlags[flag];
}
if (defaultExperimentFlagsForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
enabled ??= defaultExperimentFlagsForTesting[flag];
}
enabled ??= flag.isEnabledByDefault;
@@ -86,6 +87,7 @@
enabled = explicitExperimentalFlags[flag];
}
if (defaultExperimentFlagsForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
enabled ??= defaultExperimentFlagsForTesting[flag];
}
enabled ??= flag.isEnabledByDefault;
@@ -137,6 +139,7 @@
Version? version;
bool? enabledByDefault;
if (defaultExperimentFlagsForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
enabledByDefault = defaultExperimentFlagsForTesting[flag];
}
enabledByDefault ??= flag.isEnabledByDefault;
@@ -149,6 +152,7 @@
// If the feature is not enabled by default or is enabled by the allowed
// list use the experiment release version.
if (experimentReleasedVersionForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
version = experimentReleasedVersionForTesting[flag];
}
version ??= flag.experimentReleasedVersion;
@@ -156,6 +160,7 @@
// If the feature is enabled by default and is not enabled by the allowed
// list use the enabled version.
if (experimentEnabledVersionForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
version = experimentEnabledVersionForTesting[flag];
}
version ??= flag.experimentEnabledVersion;
@@ -172,6 +177,7 @@
Map<ExperimentalFlag, Version>? experimentReleasedVersionForTesting}) {
bool? enabledByDefault;
if (defaultExperimentFlagsForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
enabledByDefault = defaultExperimentFlagsForTesting[flag];
}
enabledByDefault ??= flag.isEnabledByDefault;
@@ -205,6 +211,7 @@
// If the feature is not enabled by default or is enabled by the allowed
// list, use the experiment release version.
if (experimentReleasedVersionForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
enabledVersion = experimentReleasedVersionForTesting[flag]!;
}
enabledVersion ??= flag.experimentReleasedVersion;
@@ -212,6 +219,7 @@
// If the feature is enabled by default and is not enabled by the allowed
// list use the enabled version.
if (experimentEnabledVersionForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
enabledVersion = experimentEnabledVersionForTesting[flag];
}
enabledVersion ??= flag.experimentEnabledVersion;
diff --git a/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart b/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
index b2c46c5..12871ff 100644
--- a/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
+++ b/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
@@ -17,6 +17,7 @@
export '../base/incremental_serializer.dart' show IncrementalSerializer;
+// Coverage-ignore(suite): Not run.
abstract class IncrementalKernelGenerator {
factory IncrementalKernelGenerator(
CompilerOptions options, List<Uri> entryPoints,
@@ -138,6 +139,7 @@
void setExperimentalFeaturesForTesting(Set<String> features);
}
+// Coverage-ignore(suite): Not run.
bool isLegalIdentifier(String identifier) {
return StringScanner.isLegalIdentifier(identifier);
}
diff --git a/pkg/front_end/lib/src/api_prototype/kernel_generator.dart b/pkg/front_end/lib/src/api_prototype/kernel_generator.dart
index 9c04367..64c3e8e 100644
--- a/pkg/front_end/lib/src/api_prototype/kernel_generator.dart
+++ b/pkg/front_end/lib/src/api_prototype/kernel_generator.dart
@@ -18,6 +18,7 @@
show generateKernel, generateKernelInternal;
import 'compiler_options.dart' show CompilerOptions;
+// Coverage-ignore(suite): Not run.
/// Generates a kernel representation of the program whose main library is in
/// the given [source].
///
@@ -44,6 +45,7 @@
additionalSources: additionalSources));
}
+// Coverage-ignore(suite): Not run.
Future<CompilerResult?> kernelForProgramInternal(
Uri source,
CompilerOptions options, {
@@ -74,6 +76,7 @@
});
}
+// Coverage-ignore(suite): Not run.
/// Generates a kernel representation for a module containing [sources].
///
/// A module is a collection of libraries that are compiled together. Libraries
diff --git a/pkg/front_end/lib/src/api_prototype/language_version.dart b/pkg/front_end/lib/src/api_prototype/language_version.dart
index 7d5cbd16..b5c73ad 100644
--- a/pkg/front_end/lib/src/api_prototype/language_version.dart
+++ b/pkg/front_end/lib/src/api_prototype/language_version.dart
@@ -19,6 +19,7 @@
export 'package:kernel/ast.dart' show Version;
+// Coverage-ignore(suite): Not run.
/// Gets the language version for a specific URI.
///
/// Note that this returning some language version, doesn't mean there aren't
@@ -128,6 +129,7 @@
});
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if the language version of [uri] does not support null
/// safety.
Future<bool> uriUsesLegacyLanguageVersion(
@@ -142,6 +144,7 @@
versionAndLibraryUri.version);
}
+// Coverage-ignore(suite): Not run.
class VersionAndPackageUri {
final Version version;
final Uri packageUri;
diff --git a/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart b/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart
index ee9e55b..a359853 100644
--- a/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart
+++ b/pkg/front_end/lib/src/api_prototype/lowering_predicates.dart
@@ -13,6 +13,7 @@
isTearOffLowering,
isTypedefTearOffLowering;
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the field holding the value of a lowered late
/// field.
///
@@ -37,6 +38,7 @@
!node.name.text.endsWith(lateIsSetSuffix);
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original field for a lowered late field where
/// [node] is the field holding the value of a lowered late field.
///
@@ -65,6 +67,7 @@
return new Name(node.name.text.substring(prefix.length), node.name.library);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the field holding the marker for whether a
/// lowered late field has been set or not.
///
@@ -91,6 +94,7 @@
node.name.text.endsWith(lateIsSetSuffix);
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original field for a lowered late field where [node]
/// is the field holding the marker for whether the lowered late field has been
/// set or not.
@@ -125,6 +129,7 @@
node.name.library);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the getter for reading the value of a lowered
/// late field.
///
@@ -160,6 +165,7 @@
return false;
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original field for a lowered late field where [node]
/// is the getter for reading the value of a lowered late field.
///
@@ -184,6 +190,7 @@
return node.name;
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the setter for setting the value of a lowered
/// late field.
///
@@ -219,6 +226,7 @@
return false;
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original field for a lowered late field where [node]
/// is the setter for setting the value of a lowered late field.
///
@@ -243,6 +251,7 @@
return node.name;
}
+// Coverage-ignore(suite): Not run.
/// Returns the original initializer of a lowered late field where [node] is
/// either the field holding the value, the field holding the marker for whether
/// it has been set or not, getter for reading the value, or the setter for
@@ -394,6 +403,7 @@
return null;
}
+// Coverage-ignore(suite): Not run.
/// Returns getter for reading the value of a lowered late field where [node] is
/// either the field holding the value, the field holding the marker for whether
/// it has been set or not, getter for reading the value, or the setter for
@@ -428,6 +438,7 @@
return null;
}
+// Coverage-ignore(suite): Not run.
/// Returns the field holding the value for a lowered late field where [node] is
/// either the field holding the value, the field holding the marker for whether
/// it has been set or not, getter for reading the value, or the setter for
@@ -481,6 +492,7 @@
return null;
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the local variable holding the value of a
/// lowered late variable.
///
@@ -503,6 +515,7 @@
return node.isLowered && isLateLoweredLocalName(node.name!);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [name] is the name of a local variable holding the value
/// of a lowered late variable.
bool isLateLoweredLocalName(String name) {
@@ -514,6 +527,7 @@
!name.contains(joinedIntermediateInfix);
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original late local variable from the [name] of the
/// local variable holding the value of the lowered late variable.
///
@@ -522,6 +536,7 @@
return name.substring(lateLocalPrefix.length);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the local variable holding the marker for
/// whether a lowered late local variable has been set or not.
///
@@ -546,12 +561,14 @@
return node.isLowered && isLateLoweredIsSetLocalName(node.name!);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [name] is the name of a local variable holding the marker
/// for whether a lowered late local variable has been set or not.
bool isLateLoweredIsSetLocalName(String name) {
return name.startsWith(lateLocalPrefix) && name.endsWith(lateIsSetSuffix);
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original late local variable from the [name] of the
/// local variable holding the marker for whether the lowered late local
/// variable has been set or not.
@@ -562,6 +579,7 @@
lateLocalPrefix.length, name.length - lateIsSetSuffix.length);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the local variable for the local function for
/// reading the value of a lowered late variable.
///
@@ -582,6 +600,7 @@
return node.isLowered && isLateLoweredLocalGetterName(node.name!);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [name] is the name of the local variable for the local
/// function for reading the value of a lowered late variable.
bool isLateLoweredLocalGetterName(String name) {
@@ -589,6 +608,7 @@
name.endsWith(lateLocalGetterSuffix);
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original late local variable from the [name] of the
/// local variable for the local function for reading the value of the lowered
/// late variable.
@@ -599,6 +619,7 @@
lateLocalPrefix.length, name.length - lateLocalGetterSuffix.length);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is the local variable for the local function for
/// setting the value of a lowered late variable.
///
@@ -620,6 +641,7 @@
return node.isLowered && isLateLoweredLocalSetterName(node.name!);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [name] is the name of the local variable for the local
/// function for setting the value of a lowered late variable.
bool isLateLoweredLocalSetterName(String name) {
@@ -627,6 +649,7 @@
name.endsWith(lateLocalSetterSuffix);
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original late local variable from the [name] of the
/// local variable for the local function for setting the value of the lowered
/// late variable.
@@ -652,7 +675,9 @@
///
/// where '#this' is the synthetic "extension this" parameter.
bool isExtensionThis(VariableDeclaration node) {
- assert(node.isLowered || node.name == null || !isExtensionThisName(node.name),
+ assert(
+ node.isLowered || node.name == null || !isExtensionThisName(node.name),
+ // Coverage-ignore(suite): Not run.
"$node has name ${node.name} and node.isLowered = ${node.isLowered}");
return node.isLowered && isExtensionThisName(node.name);
}
@@ -667,12 +692,14 @@
return name == syntheticThisName;
}
+// Coverage-ignore(suite): Not run.
/// Return `true` if [node] is the synthetic parameter holding the `this` value
/// in the encoding of extension type instance members and constructors.
bool isExtensionTypeThis(VariableDeclaration node) {
return node.isLowered && isExtensionTypeThisName(node.name);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [name] is the name of the synthetic parameter holding the
/// `this` value in the encoding of extension type instance members and
/// constructors.
@@ -680,6 +707,7 @@
return name == syntheticThisName;
}
+// Coverage-ignore(suite): Not run.
/// Returns the name of the original variable from the [name] of the synthetic
/// parameter holding the `this` value in the encoding of extension instance
/// members.
@@ -689,6 +717,7 @@
return 'this';
}
+// Coverage-ignore(suite): Not run.
/// Returns the original name of the variable [node].
///
/// If [node] is a lowered variable then the name before lowering is returned.
@@ -707,6 +736,7 @@
return node.name;
}
+// Coverage-ignore(suite): Not run.
/// Returns the original name of a variable by the given [name].
///
/// If [name] is the name of a lowered variable then the name before lowering is
@@ -717,6 +747,7 @@
return _extractLocalName(name) ?? name;
}
+// Coverage-ignore(suite): Not run.
/// Returns the original name of a lowered variable by the given [name].
///
/// If [name] doesn't correspond to a lowered name `null` is returned.
@@ -742,6 +773,7 @@
/// See [isJoinedIntermediateName] for details.
const String joinedIntermediateInfix = "#case#";
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [node] is a joined intermediate variable.
///
/// See [isJoinedIntermediateName] for details.
@@ -751,6 +783,7 @@
isJoinedIntermediateName(node.name!);
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [name] is the name of the "joined intermediate" variable
/// for a "joined local variable".
///
@@ -794,6 +827,7 @@
null;
}
+// Coverage-ignore(suite): Not run.
/// Returns the original name for a joined intermediate variable from the [name]
/// of the lowered variable.
///
@@ -812,6 +846,7 @@
return '$variableName$joinedIntermediateInfix$index';
}
+// Coverage-ignore(suite): Not run.
/// This turns Foo|bar into Foo.bar.
///
/// This only works for normal methods and operators, but for getters and
diff --git a/pkg/front_end/lib/src/api_prototype/memory_file_system.dart b/pkg/front_end/lib/src/api_prototype/memory_file_system.dart
index 8034c14..0101274 100644
--- a/pkg/front_end/lib/src/api_prototype/memory_file_system.dart
+++ b/pkg/front_end/lib/src/api_prototype/memory_file_system.dart
@@ -44,6 +44,7 @@
static Uri _addTrailingSlash(Uri uri) {
if (!uri.path.endsWith('/')) {
+ // Coverage-ignore-block(suite): Not run.
uri = uri.replace(path: uri.path + '/');
}
return uri;
@@ -69,6 +70,7 @@
other.uri == uri &&
identical(other._fileSystem, _fileSystem);
+ // Coverage-ignore(suite): Not run.
/// Create a directory for this file system entry.
///
/// If the entry is an existing file, this is an error.
@@ -86,9 +88,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Future<bool> existsAsyncIfPossible() => exists();
@override
+ // Coverage-ignore(suite): Not run.
Future<List<int>> readAsBytes() {
Uint8List? contents = _fileSystem._files[uri];
if (contents == null) {
@@ -100,9 +104,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Future<List<int>> readAsBytesAsyncIfPossible() => readAsBytes();
@override
+ // Coverage-ignore(suite): Not run.
Future<String> readAsString() async {
List<int> bytes = await readAsBytes();
try {
@@ -112,6 +118,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
/// Writes the given raw bytes to this file system entity.
///
/// If no file exists, one is created. If a file exists already, it is
@@ -124,6 +131,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
/// Writes the given string to this file system entity.
///
/// The string is encoded as UTF-8.
@@ -134,6 +142,7 @@
_update(uri, utf8.encode(s));
}
+ // Coverage-ignore(suite): Not run.
void _update(Uri uri, Uint8List data) {
if (_fileSystem._directories.contains(uri)) {
throw new FileSystemException(uri, 'Entry $uri is a directory.');
diff --git a/pkg/front_end/lib/src/api_prototype/standard_file_system.dart b/pkg/front_end/lib/src/api_prototype/standard_file_system.dart
index bf1bcff..39a9a14 100644
--- a/pkg/front_end/lib/src/api_prototype/standard_file_system.dart
+++ b/pkg/front_end/lib/src/api_prototype/standard_file_system.dart
@@ -24,7 +24,9 @@
FileSystemEntity entityForUri(Uri uri) {
if (uri.isScheme('file')) {
return new _IoFileSystemEntity(uri);
- } else if (!uri.hasScheme) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (!uri.hasScheme) {
// TODO(askesc): Empty schemes should have been handled elsewhere.
return new _IoFileSystemEntity(Uri.base.resolveUri(uri));
} else if (uri.isScheme('data')) {
@@ -56,6 +58,7 @@
return new Future.value(true);
}
if (io.FileSystemEntity.isDirectorySync(uri.toFilePath())) {
+ // Coverage-ignore-block(suite): Not run.
return new Future.value(true);
}
// TODO(CFE-team): What about [Link]s?
@@ -63,6 +66,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Future<bool> existsAsyncIfPossible() async {
if (await new io.File.fromUri(uri).exists()) {
return true;
@@ -86,6 +90,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Future<List<int>> readAsBytesAsyncIfPossible() async {
try {
CompilerContext.recordDependency(uri);
@@ -100,7 +105,9 @@
try {
CompilerContext.recordDependency(uri);
return await new io.File.fromUri(uri).readAsString();
- } on io.FileSystemException catch (exception) {
+ }
+ // Coverage-ignore(suite): Not run.
+ on io.FileSystemException catch (exception) {
throw _toFileSystemException(exception);
}
}
@@ -118,6 +125,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Concrete implementation of [FileSystemEntity] for data: URIs.
class DataFileSystemEntity implements FileSystemEntity {
@override
diff --git a/pkg/front_end/lib/src/api_prototype/summary_generator.dart b/pkg/front_end/lib/src/api_prototype/summary_generator.dart
index 2d37517..9554020 100644
--- a/pkg/front_end/lib/src/api_prototype/summary_generator.dart
+++ b/pkg/front_end/lib/src/api_prototype/summary_generator.dart
@@ -9,6 +9,7 @@
import '../kernel_generator_impl.dart';
import 'compiler_options.dart';
+// Coverage-ignore(suite): Not run.
/// Creates a summary representation of the build unit whose source files are in
/// [sources].
///
diff --git a/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart b/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart
index e60cfab..32ba567 100644
--- a/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart
+++ b/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart
@@ -10,6 +10,7 @@
export 'package:_fe_analyzer_shared/src/util/colors.dart' show enableColors;
+// Coverage-ignore(suite): Not run.
void printDiagnosticMessage(
DiagnosticMessage message, void Function(String) println) {
if (enableColors) {
diff --git a/pkg/front_end/lib/src/api_unstable/compiler_state.dart b/pkg/front_end/lib/src/api_unstable/compiler_state.dart
index 70bff8b..7fa949c 100644
--- a/pkg/front_end/lib/src/api_unstable/compiler_state.dart
+++ b/pkg/front_end/lib/src/api_unstable/compiler_state.dart
@@ -8,6 +8,7 @@
import '../base/incremental_compiler.dart' show IncrementalCompiler;
import '../base/processed_options.dart' show ProcessedOptions;
+// Coverage-ignore(suite): Not run.
class InitializedCompilerState {
final CompilerOptions options;
final ProcessedOptions processedOpts;
@@ -28,6 +29,7 @@
this.libraryToInputDill});
}
+// Coverage-ignore(suite): Not run.
/// A cached [Component] for a summary input file.
///
/// Tracks the originally marked "external" libs so that they can be restored,
@@ -38,6 +40,7 @@
WorkerInputComponent(this.digest, this.component);
}
+// Coverage-ignore(suite): Not run.
bool digestsEqual(List<int>? a, List<int>? b) {
if (a == null || b == null) return false;
if (a.length != b.length) return false;
diff --git a/pkg/front_end/lib/src/api_unstable/dart2js.dart b/pkg/front_end/lib/src/api_unstable/dart2js.dart
index 7ae6f17..6362612 100644
--- a/pkg/front_end/lib/src/api_unstable/dart2js.dart
+++ b/pkg/front_end/lib/src/api_unstable/dart2js.dart
@@ -91,6 +91,7 @@
show computePlatformBinariesLocation;
export 'compiler_state.dart' show InitializedCompilerState;
+// Coverage-ignore(suite): Not run.
InitializedCompilerState initializeCompiler(
InitializedCompilerState? oldState,
Target target,
@@ -140,6 +141,7 @@
return new InitializedCompilerState(options, processedOpts);
}
+// Coverage-ignore(suite): Not run.
Future<Component?> compile(
InitializedCompilerState state,
bool verbose,
diff --git a/pkg/front_end/lib/src/api_unstable/util.dart b/pkg/front_end/lib/src/api_unstable/util.dart
index 2200eff..af3cd9f 100644
--- a/pkg/front_end/lib/src/api_unstable/util.dart
+++ b/pkg/front_end/lib/src/api_unstable/util.dart
@@ -12,6 +12,7 @@
return true;
}
+// Coverage-ignore(suite): Not run.
bool equalSets<K>(Set<K>? a, Set<K>? b) {
if (identical(a, b)) return true;
if (a == null || b == null) return false;
@@ -22,6 +23,7 @@
return true;
}
+// Coverage-ignore(suite): Not run.
bool equalMaps<K, V>(Map<K, V>? a, Map<K, V>? b) {
if (identical(a, b)) return true;
if (a == null || b == null) return false;
diff --git a/pkg/front_end/lib/src/base/builder_graph.dart b/pkg/front_end/lib/src/base/builder_graph.dart
index c99d307..b4754b3 100644
--- a/pkg/front_end/lib/src/base/builder_graph.dart
+++ b/pkg/front_end/lib/src/base/builder_graph.dart
@@ -20,6 +20,7 @@
List<Uri> neighbors = [];
LibraryBuilder? libraryBuilder = libraryBuilders[vertex];
if (libraryBuilder == null) {
+ // Coverage-ignore-block(suite): Not run.
throw "Library not found: $vertex";
}
for (Uri importUri in libraryBuilder.dependencies) {
diff --git a/pkg/front_end/lib/src/base/command_line_reporting.dart b/pkg/front_end/lib/src/base/command_line_reporting.dart
index 0aead52..89c0127 100644
--- a/pkg/front_end/lib/src/base/command_line_reporting.dart
+++ b/pkg/front_end/lib/src/base/command_line_reporting.dart
@@ -44,7 +44,9 @@
}
String? prefix = severityPrefixes[severity];
String messageTextTmp = prefix == null
- ? message.problemMessage
+ ?
+ // Coverage-ignore(suite): Not run.
+ message.problemMessage
: "$prefix: ${message.problemMessage}";
if (message.correctionMessage != null) {
messageTextTmp += "\n${message.correctionMessage}";
@@ -58,6 +60,7 @@
break;
case Severity.warning:
+ // Coverage-ignore(suite): Not run.
messageTextColorized = magenta(messageTextPlain);
break;
@@ -65,10 +68,12 @@
messageTextColorized = green(messageTextPlain);
break;
+ // Coverage-ignore(suite): Not run.
case Severity.info:
messageTextColorized = yellow(messageTextPlain);
break;
+ // Coverage-ignore(suite): Not run.
case Severity.ignored:
return unhandled("$severity", "format", -1, null);
}
@@ -95,6 +100,7 @@
);
}
} catch (error, trace) {
+ // Coverage-ignore-block(suite): Not run.
print("Crash when formatting: "
"[${message.code.name}] ${safeToString(message.problemMessage)}\n"
"${safeToString(error)}\n"
@@ -119,6 +125,7 @@
int lengthInSourceLine = min(indentation.length, sourceLine.length);
for (int i = 0; i < lengthInSourceLine; i++) {
if (sourceLine.codeUnitAt(i) == $TAB) {
+ // Coverage-ignore-block(suite): Not run.
indentation[i] = $TAB;
}
}
@@ -145,13 +152,18 @@
bool isHidden(Severity severity) {
switch (severity) {
case Severity.error:
+ // Coverage-ignore(suite): Not run.
case Severity.internalProblem:
+ // Coverage-ignore(suite): Not run.
case Severity.context:
+ // Coverage-ignore(suite): Not run.
case Severity.info:
return false;
+ // Coverage-ignore(suite): Not run.
case Severity.warning:
return hideWarnings;
+ // Coverage-ignore(suite): Not run.
case Severity.ignored:
return true;
}
@@ -164,12 +176,15 @@
case Severity.error:
return CompilerContext.current.options.throwOnErrorsForDebugging;
+ // Coverage-ignore(suite): Not run.
case Severity.internalProblem:
return true;
+ // Coverage-ignore(suite): Not run.
case Severity.warning:
return CompilerContext.current.options.throwOnWarningsForDebugging;
+ // Coverage-ignore(suite): Not run.
case Severity.info:
case Severity.ignored:
case Severity.context:
diff --git a/pkg/front_end/lib/src/base/compiler_context.dart b/pkg/front_end/lib/src/base/compiler_context.dart
index 21a946d..0897a08 100644
--- a/pkg/front_end/lib/src/base/compiler_context.dart
+++ b/pkg/front_end/lib/src/base/compiler_context.dart
@@ -72,7 +72,9 @@
}
static void recordDependency(Uri uri) {
- if (!uri.isScheme("file") && !uri.isScheme("http")) {
+ if (!uri.isScheme("file") &&
+ // Coverage-ignore(suite): Not run.
+ !uri.isScheme("http")) {
throw new ArgumentError("Expected a file or http URI, but got: '$uri'.");
}
CompilerContext? context = Zone.current[compilerContextKey];
@@ -84,6 +86,7 @@
static CompilerContext get current {
CompilerContext? context = Zone.current[compilerContextKey];
if (context == null) {
+ // Coverage-ignore-block(suite): Not run.
// Note: we throw directly and don't use internalProblem, because
// internalProblem depends on having a compiler context available.
String problemMessage =
diff --git a/pkg/front_end/lib/src/base/crash.dart b/pkg/front_end/lib/src/base/crash.dart
index 700a143..50a70dd5 100644
--- a/pkg/front_end/lib/src/base/crash.dart
+++ b/pkg/front_end/lib/src/base/crash.dart
@@ -61,6 +61,7 @@
Future<T> reportCrash<T>(error, StackTrace trace,
[Uri? uri, int? charOffset]) async {
+ // Coverage-ignore(suite): Not run.
Future<void> note(String note) async {
stderr.write(note);
await stderr.flush();
@@ -68,6 +69,7 @@
if (hasCrashed) return new Future<T>.error(error, trace);
if (error is Crash) {
+ // Coverage-ignore-block(suite): Not run.
trace = error.trace ?? trace;
uri = error.uri ?? uri;
charOffset = error.charOffset ?? charOffset;
@@ -97,6 +99,7 @@
new Crash(uri, charOffset, error, trace).._hasBeenReported = true,
trace);
}
+ // Coverage-ignore-block(suite): Not run.
await note("\nSending crash report data");
request.persistentConnection = false;
request.bufferOutput = false;
@@ -109,9 +112,11 @@
await request.close();
await note(".");
} catch (e, s) {
+ // Coverage-ignore-block(suite): Not run.
await note("\n${safeToString(e)}\n$s\n");
await note("\n\n\nFE::ERROR::$json\n\n\n");
}
+ // Coverage-ignore-block(suite): Not run.
client.close(force: true);
await note("\n");
return new Future<T>.error(error, trace);
@@ -121,6 +126,7 @@
try {
return "$object";
} catch (e) {
+ // Coverage-ignore-block(suite): Not run.
return "Error when converting ${object.runtimeType} to string.";
}
}
diff --git a/pkg/front_end/lib/src/base/export.dart b/pkg/front_end/lib/src/base/export.dart
index 5d2076a..e16ec9c 100644
--- a/pkg/front_end/lib/src/base/export.dart
+++ b/pkg/front_end/lib/src/base/export.dart
@@ -36,7 +36,9 @@
if (combinators != null) {
for (CombinatorBuilder combinator in combinators!) {
if (combinator.isShow && !combinator.names.contains(name)) return false;
- if (combinator.isHide && combinator.names.contains(name)) return false;
+ if (combinator.isHide &&
+ // Coverage-ignore(suite): Not run.
+ combinator.names.contains(name)) return false;
}
}
return exporter.addToExportScope(name, member, charOffset);
diff --git a/pkg/front_end/lib/src/base/hybrid_file_system.dart b/pkg/front_end/lib/src/base/hybrid_file_system.dart
index 61ccabb..07e33b2 100644
--- a/pkg/front_end/lib/src/base/hybrid_file_system.dart
+++ b/pkg/front_end/lib/src/base/hybrid_file_system.dart
@@ -17,7 +17,8 @@
final FileSystem physical;
HybridFileSystem(this.memory, [FileSystem? _physical])
- : physical = _physical ?? StandardFileSystem.instance;
+ : physical = _physical ?? // Coverage-ignore(suite): Not run.
+ StandardFileSystem.instance;
@override
FileSystemEntity entityForUri(Uri uri) =>
@@ -36,12 +37,17 @@
Future<FileSystemEntity> get delegate async {
if (_delegate != null) {
+ // Coverage-ignore-block(suite): Not run.
return _delegate!;
}
FileSystemEntity entity = _fs.memory.entityForUri(uri);
- if (((!uri.isScheme('file') && !uri.isScheme('data')) &&
+ if (((!uri.isScheme('file') &&
+ // Coverage-ignore(suite): Not run.
+ !uri.isScheme('data')) &&
+ // Coverage-ignore(suite): Not run.
_fs.physical is StandardFileSystem) ||
await entity.exists()) {
+ // Coverage-ignore-block(suite): Not run.
_delegate = entity;
return _delegate!;
}
@@ -49,9 +55,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Future<bool> exists() async => (await delegate).exists();
@override
+ // Coverage-ignore(suite): Not run.
Future<bool> existsAsyncIfPossible() async =>
(await delegate).existsAsyncIfPossible();
@@ -59,9 +67,11 @@
Future<List<int>> readAsBytes() async => (await delegate).readAsBytes();
@override
+ // Coverage-ignore(suite): Not run.
Future<List<int>> readAsBytesAsyncIfPossible() async =>
(await delegate).readAsBytesAsyncIfPossible();
@override
+ // Coverage-ignore(suite): Not run.
Future<String> readAsString() async => (await delegate).readAsString();
}
diff --git a/pkg/front_end/lib/src/base/identifiers.dart b/pkg/front_end/lib/src/base/identifiers.dart
index ea310eb..265ad03 100644
--- a/pkg/front_end/lib/src/base/identifiers.dart
+++ b/pkg/front_end/lib/src/base/identifiers.dart
@@ -87,9 +87,11 @@
@override
String get name => operator.text;
+ // Coverage-ignore(suite): Not run.
int get charOffset => token.charOffset;
@override
+ // Coverage-ignore(suite): Not run.
int get firstOffset => token.charOffset;
@override
@@ -99,14 +101,17 @@
int get nameOffset => token.charOffset;
@override
+ // Coverage-ignore(suite): Not run.
Expression? get initializer => null;
@override
+ // Coverage-ignore(suite): Not run.
QualifiedName withQualifier(Object qualifier) {
return unsupported("withQualifier", charOffset, null);
}
@override
+ // Coverage-ignore(suite): Not run.
TypeName get typeName {
return unsupported("typeName", charOffset, null);
}
@@ -123,11 +128,13 @@
: super(identifier.token);
@override
+ // Coverage-ignore(suite): Not run.
QualifiedName withQualifier(Object qualifier) {
return unsupported("withQualifier", charOffset, null);
}
@override
+ // Coverage-ignore(suite): Not run.
TypeName get typeName {
return unsupported("typeName", charOffset, null);
}
@@ -154,6 +161,7 @@
int get nameOffset => token.charOffset;
@override
+ // Coverage-ignore(suite): Not run.
QualifiedName withQualifier(Object qualifier) {
return unsupported("withQualifier", charOffset, null);
}
@@ -173,7 +181,9 @@
flattenQualifiedNameOn(qualifier, buffer, charOffset, fileUri);
} else if (qualifier is Identifier) {
buffer.write(qualifier.name);
- } else if (qualifier is String) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (qualifier is String) {
buffer.write(qualifier);
} else {
unhandled("${qualifier.runtimeType}", "flattenQualifiedNameOn", charOffset,
diff --git a/pkg/front_end/lib/src/base/import_chains.dart b/pkg/front_end/lib/src/base/import_chains.dart
index 04158a8..af09cc8 100644
--- a/pkg/front_end/lib/src/base/import_chains.dart
+++ b/pkg/front_end/lib/src/base/import_chains.dart
@@ -63,6 +63,7 @@
if (!importChains.contains(importChain)) {
if (importChains.length > compactChainLimit) {
+ // Coverage-ignore-block(suite): Not run.
importChains.add('...');
return false;
} else {
@@ -72,6 +73,7 @@
chainCount++;
if (chainCount > chainLimit) {
+ // Coverage-ignore-block(suite): Not run.
// Assume there are more import chains.
importChains.add('...');
return false;
@@ -207,6 +209,7 @@
String packageName = uri.path.substring(0, slashPos);
return new PackageLocation(packageName);
} else {
+ // Coverage-ignore-block(suite): Not run.
// This is an invalid import uri, like "package:foo.dart".
return new UriLocation(uri);
}
diff --git a/pkg/front_end/lib/src/base/incremental_compiler.dart b/pkg/front_end/lib/src/base/incremental_compiler.dart
index 357c8d1..da086d4 100644
--- a/pkg/front_end/lib/src/base/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/base/incremental_compiler.dart
@@ -119,8 +119,10 @@
DillTarget? _dillLoadedData;
List<DillLibraryBuilder>? _platformBuilders;
+ // Coverage-ignore(suite): Not run.
List<DillLibraryBuilder>? get platformBuildersForTesting => _platformBuilders;
Map<Uri, DillLibraryBuilder>? _userBuilders;
+ // Coverage-ignore(suite): Not run.
Map<Uri, DillLibraryBuilder>? get userBuildersForTesting => _userBuilders;
final _InitializationStrategy _initializationStrategy;
@@ -170,6 +172,7 @@
_enableExperimentsBasedOnEnvironment();
}
+ // Coverage-ignore(suite): Not run.
IncrementalCompiler(this.context,
[Uri? _initializeFromDillUri,
bool? outlineOnly,
@@ -184,6 +187,7 @@
_enableExperimentsBasedOnEnvironment();
}
+ // Coverage-ignore(suite): Not run.
IncrementalCompiler.forExpressionCompilationOnly(
this.context, Component? _componentToInitializeFrom,
[bool? resetTicker])
@@ -198,23 +202,29 @@
_enableExperimentsBasedOnEnvironment();
}
+ // Coverage-ignore(suite): Not run.
bool get initializedFromDillForTesting =>
_initializationStrategy.initializedFromDillForTesting;
+ // Coverage-ignore(suite): Not run.
bool get initializedIncrementalSerializerForTesting =>
_initializationStrategy.initializedIncrementalSerializerForTesting;
+ // Coverage-ignore(suite): Not run.
DillTarget? get dillTargetForTesting => _dillLoadedData;
IncrementalKernelTarget? get kernelTargetForTesting => _lastGoodKernelTarget;
+ // Coverage-ignore(suite): Not run.
bool get skipExperimentalInvalidationChecksForTesting => false;
+ // Coverage-ignore(suite): Not run.
/// Returns the [Package] used for the package [packageName] in the most
/// recent compilation.
Package? getPackageForPackageName(String packageName) =>
_currentPackagesMap?[packageName];
+ // Coverage-ignore(suite): Not run.
/// Returns the [Library] with the given [importUri] from the most recent
/// compilation.
Library? lookupLibrary(Uri importUri) => _lastGoodKernelTarget?.loader
@@ -225,11 +235,13 @@
// Note that these are all experimental. Use at your own risk.
enabledExperiments ??= getExperimentEnvironment();
if (enabledExperiments.contains(enableIncrementalCompilerBenchmarking)) {
+ // Coverage-ignore-block(suite): Not run.
_benchmarker = new Benchmarker();
}
}
@override
+ // Coverage-ignore(suite): Not run.
void setExperimentalFeaturesForTesting(Set<String> features) {
_enableExperimentsBasedOnEnvironment(enabledExperiments: features);
}
@@ -240,6 +252,7 @@
bool fullComponent = false,
bool trackNeededDillLibraries = false}) async {
while (_currentlyCompiling != null) {
+ // Coverage-ignore-block(suite): Not run.
await _currentlyCompiling!.future;
}
_currentlyCompiling = new Completer();
@@ -261,17 +274,25 @@
}
_computeDeltaRunOnce = true;
IncrementalKernelTarget? lastGoodKernelTarget = _lastGoodKernelTarget;
- _benchmarker?.reset();
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.reset();
// Initial setup: Load platform, initialize from dill or component etc.
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_setupPackages);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_setupPackages);
UriTranslator uriTranslator = await _setupPackagesAndUriTranslator(c);
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_ensurePlatform);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_ensurePlatform);
IncrementalCompilerData data =
await _ensurePlatformAndInitialize(uriTranslator, c);
// Figure out what to keep and what to throw away.
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_invalidate);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_invalidate);
Set<Uri?> invalidatedUris = this._invalidatedUris.toSet();
_invalidateNotKeptUserBuilders(invalidatedUris);
ReusageResult? reusedResult = _computeReusedLibraries(
@@ -279,6 +300,7 @@
// Experimental invalidation initialization (e.g. figure out if we can).
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.incremental_experimentalInvalidation);
ExperimentalInvalidation? experimentalInvalidation =
await _initializeExperimentalInvalidation(
@@ -287,17 +309,21 @@
experimentalInvalidation?.missingSources.length ?? 0);
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.incremental_rewriteEntryPointsIfPart);
_rewriteEntryPointsIfPart(entryPoints, reusedResult);
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.incremental_invalidatePrecompiledMacros);
await _invalidatePrecompiledMacros(
c.options, reusedResult.notReusedLibraries);
// Cleanup: After (potentially) removing builders we have stuff to cleanup
// to not leak, and we might need to re-create the dill target.
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_cleanup);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_cleanup);
_cleanupRemovedBuilders(
lastGoodKernelTarget, reusedResult, uriTranslator);
_recreateDillTargetIfPackageWasUpdated(uriTranslator, c);
@@ -315,9 +341,11 @@
// For modular compilation we can be asked to load components and track
// which libraries we actually use for the compilation. Set that up now.
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.incremental_loadEnsureLoadedComponents);
_loadEnsureLoadedComponents(reusedLibraries);
if (trackNeededDillLibraries) {
+ // Coverage-ignore-block(suite): Not run.
_resetTrackingOfUsedLibraries(hierarchy);
}
@@ -326,7 +354,9 @@
// builders needs to be patched up.
IncrementalKernelTarget currentKernelTarget;
while (true) {
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_setupInLoop);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_setupInLoop);
currentKernelTarget = _setupNewKernelTarget(c, uriTranslator, hierarchy,
reusedLibraries, experimentalInvalidation, entryPoints);
Map<DillLibraryBuilder, List<CompilationUnit>>? rebuildBodiesMap =
@@ -337,20 +367,27 @@
// TODO(johnniwinther,jensj): Ensure that the internal state of the
// incremental compiler is consistent across 1 or more macro
// precompilations.
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_precompileMacros);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_precompileMacros);
NeededPrecompilations? neededPrecompilations =
await currentKernelTarget.computeNeededPrecompilations();
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_precompileMacros);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_precompileMacros);
if (context.options.globalFeatures.macros.isEnabled) {
Map<Uri, macros.ExecutorFactoryToken>? precompiled =
await precompileMacros(neededPrecompilations, c.options);
if (precompiled != null) {
+ // Coverage-ignore-block(suite): Not run.
macroExecutorFactoryTokens.addAll(precompiled);
continue;
}
}
- _benchmarker?.enterPhase(
- BenchmarkPhases.incremental_experimentalInvalidationPatchUpScopes);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases
+ .incremental_experimentalInvalidationPatchUpScopes);
_experimentalInvalidationPatchUpScopes(
experimentalInvalidation, rebuildBodiesMap);
rebuildBodiesMap = null;
@@ -374,15 +411,21 @@
verify: c.options.verify);
componentWithDill = buildResult.component;
}
- buildResult.macroApplications?.close();
+ buildResult.macroApplications
+ // Coverage-ignore(suite): Not run.
+ ?.close();
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_hierarchy);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_hierarchy);
hierarchy ??= currentKernelTarget.loader.hierarchy;
if (currentKernelTarget.classHierarchyChanges != null) {
+ // Coverage-ignore-block(suite): Not run.
hierarchy.applyTreeChanges(
[], [], currentKernelTarget.classHierarchyChanges!);
}
if (currentKernelTarget.classMemberChanges != null) {
+ // Coverage-ignore-block(suite): Not run.
hierarchy.applyMemberChanges(currentKernelTarget.classMemberChanges!,
findDescendants: true);
}
@@ -390,6 +433,7 @@
Set<Library>? neededDillLibraries;
if (trackNeededDillLibraries) {
+ // Coverage-ignore-block(suite): Not run.
_benchmarker
?.enterPhase(BenchmarkPhases.incremental_performDillUsageTracking);
// Perform actual dill usage tracking.
@@ -403,6 +447,7 @@
// assumed always to be non-null.
if (componentWithDill != null) {
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.incremental_releaseAncillaryResources);
this._invalidatedUris.clear();
_hasToCheckPackageUris = false;
@@ -413,18 +458,23 @@
// Compute which libraries to output and which (previous) errors/warnings
// we have to reissue. In the process do some cleanup too.
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.incremental_releaseAncillaryResources);
List<Library> compiledLibraries =
new List<Library>.of(currentKernelTarget.loader.libraries);
Map<Uri, Source> uriToSource = componentWithDill!.uriToSource;
- _benchmarker?.enterPhase(BenchmarkPhases
- .incremental_experimentalCompilationPostCompilePatchup);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases
+ .incremental_experimentalCompilationPostCompilePatchup);
_experimentalCompilationPostCompilePatchup(
experimentalInvalidation, compiledLibraries, uriToSource);
- _benchmarker?.enterPhase(BenchmarkPhases
- .incremental_calculateOutputLibrariesAndIssueLibraryProblems);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases
+ .incremental_calculateOutputLibrariesAndIssueLibraryProblems);
Set<LibraryBuilder> cleanedUpBuilders = {};
List<Library> outputLibraries =
@@ -447,13 +497,16 @@
// calculation has the potential to work.
// ignore: unnecessary_null_comparison
if (componentWithDill == null) {
+ // Coverage-ignore-block(suite): Not run.
currentKernelTarget.loader.clearLibraryBuilders();
currentKernelTarget = lastGoodKernelTarget!;
_dillLoadedData!.loader.currentSourceLoader =
currentKernelTarget.loader;
} else {
- _benchmarker?.enterPhase(
- BenchmarkPhases.incremental_convertSourceLibraryBuildersToDill);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(
+ BenchmarkPhases.incremental_convertSourceLibraryBuildersToDill);
_previousSourceBuilders = _convertSourceLibraryBuildersToDill(
currentKernelTarget,
experimentalInvalidation,
@@ -461,17 +514,23 @@
);
}
- _benchmarker?.enterPhase(BenchmarkPhases.incremental_end);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.incremental_end);
experimentalInvalidation = null;
// Output result.
// ignore: unnecessary_null_comparison
Procedure? mainMethod = componentWithDill == null
- ? data.component?.mainMethod
+ ?
+ // Coverage-ignore(suite): Not run.
+ data.component?.mainMethod
: componentWithDill.mainMethod;
// ignore: unnecessary_null_comparison
NonNullableByDefaultCompiledMode? compiledMode = componentWithDill == null
- ? data.component?.mode
+ ?
+ // Coverage-ignore(suite): Not run.
+ data.component?.mode
: componentWithDill.mode;
Component result = context.options.target.configureComponent(
new Component(libraries: outputLibraries, uriToSource: uriToSource))
@@ -485,9 +544,12 @@
_lastGoodKernelTarget = currentKernelTarget;
- _benchmarker?.stop();
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.stop();
if (_benchmarker != null) {
+ // Coverage-ignore-block(suite): Not run.
// Report.
JsonEncoder encoder = new JsonEncoder.withIndent(" ");
print(encoder.convert(_benchmarker));
@@ -596,6 +658,7 @@
convertedLibraries = null;
experimentalInvalidation = null;
if (_userBuilders!.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
_userBuilders = null;
}
return newDillLibraryBuilders;
@@ -605,6 +668,7 @@
SourceLoader sourceLoader, DillLoader dillLoader) {
for (SourceLibraryBuilder sourceLibraryBuilder
in sourceLoader.sourceLibraryBuilders) {
+ // Coverage-ignore-block(suite): Not run.
Uri uri = sourceLibraryBuilder.importUri;
DillLibraryBuilder dillLibraryBuilder =
dillLoader.lookupLibraryBuilder(uri)!;
@@ -616,6 +680,7 @@
return true;
}
+ // Coverage-ignore(suite): Not run.
String? _hasEquivalentScopes(SourceLibraryBuilder sourceLibraryBuilder,
DillLibraryBuilder dillLibraryBuilder) {
bool isEquivalent = true;
@@ -705,12 +770,14 @@
);
allLibraries = outputLibraries.toSet();
if (!c.options.omitPlatform) {
+ // Coverage-ignore-block(suite): Not run.
for (int i = 0; i < _platformBuilders!.length; i++) {
Library lib = _platformBuilders![i].library;
outputLibraries.add(lib);
}
}
} else {
+ // Coverage-ignore-block(suite): Not run.
outputLibraries = <Library>[];
allLibraries = _computeTransitiveClosure(
currentKernelTarget,
@@ -751,6 +818,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
/// Perform dill usage tracking if asked. Use the marking on dill builders as
/// well as the class hierarchy to figure out which dill libraries was
/// actually used by the compilation.
@@ -808,6 +876,7 @@
}
assert(
!map.containsKey(name),
+ // Coverage-ignore(suite): Not run.
"Unexpected double-entry for $name in "
"${compilationUnit.importUri} (org from ${entry.key.importUri}): "
"$childBuilder and ${map[name]}");
@@ -928,6 +997,7 @@
if (c.options.globalFeatures.nonNullable.isEnabled) {
switch (c.options.nnbdMode) {
case NnbdMode.Weak:
+ // Coverage-ignore(suite): Not run.
// Don't expect strong or invalid.
if (seenModes[NonNullableByDefaultCompiledMode.Strong.index] ||
seenModes[NonNullableByDefaultCompiledMode.Invalid.index]) {
@@ -938,11 +1008,13 @@
// Don't expect weak or invalid.
if (seenModes[NonNullableByDefaultCompiledMode.Weak.index] ||
seenModes[NonNullableByDefaultCompiledMode.Invalid.index]) {
+ // Coverage-ignore-block(suite): Not run.
kernelTarget.loader.hasInvalidNnbdModeLibrary = true;
}
break;
}
} else {
+ // Coverage-ignore-block(suite): Not run.
// Don't expect strong or invalid.
if (seenModes[NonNullableByDefaultCompiledMode.Strong.index] ||
seenModes[NonNullableByDefaultCompiledMode.Invalid.index]) {
@@ -959,6 +1031,7 @@
return kernelTarget;
}
+ // Coverage-ignore(suite): Not run.
/// When tracking used libraries we mark them when we use them. To track
/// correctly we have to unmark before the next iteration to not have too much
/// marked and therefore incorrectly marked something as used when it is not.
@@ -1016,6 +1089,7 @@
void _recreateDillTargetIfPackageWasUpdated(
UriTranslator uriTranslator, CompilerContext c) {
if (_hasToCheckPackageUris) {
+ // Coverage-ignore-block(suite): Not run.
// The package file was changed.
// Make sure the dill loader is on the same page.
DillTarget oldDillLoadedData = _dillLoadedData!;
@@ -1045,7 +1119,9 @@
for (LibraryBuilder builder in reusedResult.notReusedLibraries) {
_cleanupSourcesForBuilder(lastGoodKernelTarget, reusedResult, builder,
uriTranslator, CompilerContext.current.uriToSource);
- _incrementalSerializer?.invalidate(builder.fileUri);
+ _incrementalSerializer
+ // Coverage-ignore(suite): Not run.
+ ?.invalidate(builder.fileUri);
LibraryBuilder? dillBuilder =
_dillLoadedData!.loader.deregisterLibraryBuilder(builder.importUri);
@@ -1093,11 +1169,13 @@
if (!context
.options.globalFeatures.alternativeInvalidationStrategy.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
recorderForTesting?.recordAdvancedInvalidationResult(
AdvancedInvalidationResult.disabled);
return null;
}
if (_modulesToLoad != null) {
+ // Coverage-ignore-block(suite): Not run.
recorderForTesting?.recordAdvancedInvalidationResult(
AdvancedInvalidationResult.modulesToLoad);
return null;
@@ -1108,6 +1186,7 @@
return null;
}
if (reusedResult.invalidatedBecauseOfPackageUpdate) {
+ // Coverage-ignore-block(suite): Not run.
recorderForTesting?.recordAdvancedInvalidationResult(
AdvancedInvalidationResult.packageUpdate);
return null;
@@ -1169,6 +1248,7 @@
String? before = textualOutline(previousSource, scannerConfiguration,
performModelling: true, enablePatterns: enablePatterns);
if (before == null) {
+ // Coverage-ignore-block(suite): Not run.
recorderForTesting?.recordAdvancedInvalidationResult(
AdvancedInvalidationResult.noPreviousOutline);
return null;
@@ -1241,7 +1321,10 @@
AdvancedInvalidationResult.importsFfi);
return null;
}
- for (Reference exportReference in importLibrary.additionalExports) {
+ for (Reference exportReference
+ in importLibrary // Coverage-ignore(suite): Not run.
+ .additionalExports) {
+ // Coverage-ignore-block(suite): Not run.
NamedNode? export = exportReference.node;
if (export is Class) {
Class c = export;
@@ -1288,6 +1371,7 @@
CompilerContext c) async {
bool bypassCache = false;
if (!identical(_previousPackagesUri, c.options.packagesUriRaw)) {
+ // Coverage-ignore-block(suite): Not run.
_previousPackagesUri = c.options.packagesUriRaw;
bypassCache = true;
} else if (this._invalidatedUris.contains(c.options.packagesUri)) {
@@ -1302,6 +1386,7 @@
_hasToCheckPackageUris = _hasToCheckPackageUris || bypassCache;
_ticker.logMs("Read packages file");
if (_initializedForExpressionCompilationOnly) {
+ // Coverage-ignore-block(suite): Not run.
_hasToCheckPackageUris = false;
}
return uriTranslator;
@@ -1344,6 +1429,7 @@
if (builder.importUri.isScheme("dart")) {
_platformBuilders!.add(builder);
} else {
+ // Coverage-ignore-block(suite): Not run.
_userBuilders![builder.importUri] = builder;
}
}
@@ -1353,6 +1439,7 @@
return data;
}
+ // Coverage-ignore(suite): Not run.
/// Allows for updating the list of needed libraries.
///
/// Useful if a class hierarchy has been used externally.
@@ -1436,6 +1523,7 @@
return;
}
if (macroExecutorFactoryTokens.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
await Future.wait(notReusedLibraries
.map((library) => library.importUri)
.where(macroExecutorFactoryTokens.containsKey)
@@ -1448,7 +1536,10 @@
/// Internal method.
void _invalidateNotKeptUserBuilders(Set<Uri?> invalidatedUris) {
- if (_modulesToLoad != null && _userBuilders != null) {
+ if (_modulesToLoad != null &&
+ // Coverage-ignore(suite): Not run.
+ _userBuilders != null) {
+ // Coverage-ignore-block(suite): Not run.
Set<Library> loadedNotKept = new Set<Library>();
for (LibraryBuilder builder in _userBuilders!.values) {
loadedNotKept.add(builder.library);
@@ -1465,6 +1556,7 @@
/// Internal method.
void _loadEnsureLoadedComponents(List<LibraryBuilder> reusedLibraries) {
if (_modulesToLoad != null) {
+ // Coverage-ignore-block(suite): Not run.
bool loadedAnything = false;
for (Component module in _modulesToLoad!) {
bool usedComponent = false;
@@ -1561,6 +1653,7 @@
}
if (library.importUri.isScheme("dart")) {
result.add(library);
+ // Coverage-ignore-block(suite): Not run.
inputLibrariesFiltered?.add(library);
} else {
potentiallyReferencedLibraries[library.importUri] = library;
@@ -1603,6 +1696,7 @@
if (library != null) {
result.add(library);
if (potentiallyReferencedInputLibraries.remove(uri) != null) {
+ // Coverage-ignore-block(suite): Not run.
inputLibrariesFiltered?.add(library);
}
for (LibraryPart part in library.parts) {
@@ -1617,6 +1711,7 @@
List<Library> removedLibraries = <Library>[];
bool removedDillBuilders = false;
for (Uri uri in potentiallyReferencedLibraries.keys) {
+ // Coverage-ignore-block(suite): Not run.
if (uri.isScheme("package")) continue;
LibraryBuilder? builder =
currentKernelTarget.loader.deregisterLoadedLibraryBuilder(uri);
@@ -1647,6 +1742,7 @@
}
hierarchy.applyTreeChanges(removedLibraries, const [], const []);
if (removedDillBuilders) {
+ // Coverage-ignore-block(suite): Not run.
_makeDillLoaderLibrariesUpToDateWithBuildersMap();
}
@@ -1679,11 +1775,14 @@
[Map<Uri, Source>? uriToSourceExtra,
Set<Uri?>? partsUsed]) {
uriToSource.remove(builder.fileUri);
+ // Coverage-ignore(suite): Not run.
uriToSourceExtra?.remove(builder.fileUri);
Library lib = builder.library;
for (LibraryPart part in lib.parts) {
Uri? partFileUri = uriTranslator.getPartFileUri(lib.fileUri, part);
- if (partsUsed != null && partsUsed.contains(partFileUri)) continue;
+ if (partsUsed != null &&
+ // Coverage-ignore(suite): Not run.
+ partsUsed.contains(partFileUri)) continue;
// If the builders map contain the "parts" import uri, it's a real library
// (erroneously) used as a part so we don't want to remove that.
@@ -1694,7 +1793,9 @@
.containsLoadedLibraryBuilder(partImportUri)) {
continue;
}
- } else if (reusedResult != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (reusedResult != null) {
// We've just launched and don't have [lastGoodKernelTarget] yet. Search
// reusedResult for a kept library with this uri.
bool found = false;
@@ -1710,6 +1811,7 @@
}
}
uriToSource.remove(partFileUri);
+ // Coverage-ignore-block(suite): Not run.
uriToSourceExtra?.remove(partFileUri);
}
}
@@ -1724,6 +1826,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Future<Procedure?> compileExpression(
String expression,
Map<String, DartType> inputDefinitions,
@@ -2002,6 +2105,7 @@
});
}
+ // Coverage-ignore(suite): Not run.
bool _packagesEqual(Package? a, Package? b) {
if (a == null || b == null) return false;
if (a.name != b.name) return false;
@@ -2045,7 +2149,10 @@
if (importUri != fileUri && invalidatedUris.contains(fileUri)) {
return true;
}
- if (_hasToCheckPackageUris && importUri.isScheme("package")) {
+ if (_hasToCheckPackageUris &&
+ // Coverage-ignore(suite): Not run.
+ importUri.isScheme("package")) {
+ // Coverage-ignore-block(suite): Not run.
// Get package name, check if the base URI has changed for the package,
// if it has, translate the URI again,
// otherwise the URI cannot have changed.
@@ -2107,6 +2214,7 @@
libraryBuilder.importUri, libraryBuilder as DillLibraryBuilder);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
// [lastGoodKernelTarget] was null so we explicitly have to add the
// builders from [userBuilders] (which cannot be null as we checked
// initially that one of them was non-null).
@@ -2139,6 +2247,7 @@
if (current != null) {
Set<Uri>? s = directDependencies[current.importUri];
if (current.importUri != removed) {
+ // Coverage-ignore-block(suite): Not run.
if (s == null) {
s = directDependencies[removed];
} else {
@@ -2175,6 +2284,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void invalidateAllSources() {
IncrementalKernelTarget? lastGoodKernelTarget = this._lastGoodKernelTarget;
if (lastGoodKernelTarget != null) {
@@ -2191,11 +2301,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void setModulesToLoadOnNextComputeDelta(List<Component> components) {
_modulesToLoad = components.toList();
}
}
+// Coverage-ignore(suite): Not run.
class _ExtensionTypeFinder extends VisitorDefault<void> with VisitorVoidMixin {
static bool isOrContainsExtensionType(DartType type) {
if (type is ExtensionType) return true;
@@ -2280,12 +2392,14 @@
ChangedStructureNotifier get changedStructureNotifier => this;
@override
+ // Coverage-ignore(suite): Not run.
void registerClassMemberChange(Class c) {
classMemberChanges ??= new Set<Class>();
classMemberChanges!.add(c);
}
@override
+ // Coverage-ignore(suite): Not run.
void registerClassHierarchyChange(Class cls) {
classHierarchyChanges ??= <Class>{};
classHierarchyChanges!.add(cls);
@@ -2306,14 +2420,17 @@
: const _InitializationFromSdkSummary();
}
+ // Coverage-ignore(suite): Not run.
factory _InitializationStrategy.fromUri(Uri? uri) {
return uri != null
? new _InitializationFromUri(uri)
: const _InitializationFromSdkSummary();
}
+ // Coverage-ignore(suite): Not run.
bool get initializedFromDillForTesting => false;
+ // Coverage-ignore(suite): Not run.
bool get initializedIncrementalSerializerForTesting => false;
Future<int> initialize(
@@ -2330,6 +2447,7 @@
const _InitializationFromSdkSummary();
@override
+ // Coverage-ignore(suite): Not run.
Future<int> initialize(
DillTarget dillLoadedData,
UriTranslator uriTranslator,
@@ -2343,6 +2461,7 @@
dillLoadedData, summaryBytes, uriTranslator, context, data);
}
+ // Coverage-ignore(suite): Not run.
int _prepareSummary(
DillTarget dillLoadedTarget,
List<int>? summaryBytes,
@@ -2391,8 +2510,13 @@
Component component = data.component = new Component(
libraries: componentToInitializeFrom.libraries,
uriToSource: componentToInitializeFrom.uriToSource)
- ..setMainMethodAndMode(componentToInitializeFrom.mainMethod?.reference,
- true, componentToInitializeFrom.mode);
+ ..setMainMethodAndMode(
+ componentToInitializeFrom
+ .mainMethod
+ // Coverage-ignore(suite): Not run.
+ ?.reference,
+ true,
+ componentToInitializeFrom.mode);
componentProblems.saveComponentProblems(component);
bool foundDartCore = false;
@@ -2415,6 +2539,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _InitializationFromUri extends _InitializationFromSdkSummary {
Uri initializeFromDillUri;
@@ -2588,6 +2713,7 @@
_remainingComponentProblems.remove(lib.fileUri);
// Remove parts too.
for (LibraryPart part in lib.parts) {
+ // Coverage-ignore-block(suite): Not run.
Uri? partFileUri = uriTranslator.getPartFileUri(lib.fileUri, part);
_remainingComponentProblems.remove(partFileUri);
}
@@ -2607,6 +2733,7 @@
// Report old problems that wasn't reported again.
for (MapEntry<Uri, List<DiagnosticMessageFromJson>> entry
in _remainingComponentProblems.entries) {
+ // Coverage-ignore-block(suite): Not run.
List<DiagnosticMessageFromJson> messages = entry.value;
for (int i = 0; i < messages.length; i++) {
DiagnosticMessageFromJson message = messages[i];
@@ -2632,6 +2759,7 @@
new DiagnosticMessageFromJson.fromJson(jsonString);
assert(
message.uri != null ||
+ // Coverage-ignore(suite): Not run.
(message.involvedFiles != null &&
message.involvedFiles!.isNotEmpty),
jsonString);
@@ -2642,6 +2770,7 @@
messages.add(message);
}
if (message.involvedFiles != null) {
+ // Coverage-ignore-block(suite): Not run.
// This indexes the same message under several uris - this way it will
// be issued as long as it's a problem. It will because of
// deduplication when we re-issue these (in reissueComponentProblems)
@@ -2662,6 +2791,7 @@
Uri? getPartFileUri(Uri parentFileUri, LibraryPart part) {
Uri? fileUri = getPartUri(parentFileUri, part);
if (fileUri.isScheme("package")) {
+ // Coverage-ignore-block(suite): Not run.
// Part was specified via package URI and the resolve above thus
// did not go as expected. Translate the package URI to get the
// actual file URI.
@@ -2722,13 +2852,18 @@
class RecorderForTesting {
const RecorderForTesting();
+ // Coverage-ignore(suite): Not run.
void recordAdvancedInvalidationResult(AdvancedInvalidationResult result) {}
+ // Coverage-ignore(suite): Not run.
void recordNonFullComponent(Component component) {}
+ // Coverage-ignore(suite): Not run.
void recordInvalidatedImportUris(List<Uri> uris) {}
+ // Coverage-ignore(suite): Not run.
void recordRebuildBodiesCount(int count) {}
+ // Coverage-ignore(suite): Not run.
void recordTemporaryFile(Uri uri) {}
}
diff --git a/pkg/front_end/lib/src/base/incremental_serializer.dart b/pkg/front_end/lib/src/base/incremental_serializer.dart
index 334fa06..dae0ea5 100644
--- a/pkg/front_end/lib/src/base/incremental_serializer.dart
+++ b/pkg/front_end/lib/src/base/incremental_serializer.dart
@@ -12,6 +12,7 @@
import '../kernel/utils.dart' show ByteSink;
+// Coverage-ignore(suite): Not run.
class IncrementalSerializer {
final Map<Uri, SerializationGroup> uriToGroup =
new Map<Uri, SerializationGroup>();
@@ -326,6 +327,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class SerializationGroup {
final Uint8List serializedData;
final Set<Uri> uris;
diff --git a/pkg/front_end/lib/src/base/library_graph.dart b/pkg/front_end/lib/src/base/library_graph.dart
index 64a5d3b..580d6e94 100644
--- a/pkg/front_end/lib/src/base/library_graph.dart
+++ b/pkg/front_end/lib/src/base/library_graph.dart
@@ -16,12 +16,14 @@
LibraryGraph(this.libraries);
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Uri> get vertices => libraries.keys;
@override
Iterable<Uri> neighborsOf(Uri vertex) sync* {
Library? library = libraries[vertex];
if (library == null) {
+ // Coverage-ignore-block(suite): Not run.
throw "Library not found: $vertex";
}
diff --git a/pkg/front_end/lib/src/base/problems.dart b/pkg/front_end/lib/src/base/problems.dart
index 1d333d0..f160fac 100644
--- a/pkg/front_end/lib/src/base/problems.dart
+++ b/pkg/front_end/lib/src/base/problems.dart
@@ -20,6 +20,7 @@
templateInternalProblemUnimplemented,
templateInternalProblemUnsupported;
+// Coverage-ignore(suite): Not run.
class DebugAbort {
final LocatedMessage message;
@@ -36,6 +37,7 @@
String toString() => "DebugAbort: ${message.problemMessage}";
}
+// Coverage-ignore(suite): Not run.
/// Used to report an internal error.
///
/// Internal errors should be avoided as best as possible, but are preferred
@@ -58,6 +60,7 @@
}
}
+// Coverage-ignore(suite): Not run.
Never unimplemented(String what, int charOffset, Uri? uri) {
return internalProblem(
templateInternalProblemUnimplemented.withArguments(what),
@@ -65,6 +68,7 @@
uri);
}
+// Coverage-ignore(suite): Not run.
Never unhandled(String what, String where, int charOffset, Uri? uri) {
return internalProblem(
templateInternalProblemUnhandled.withArguments(what, where),
@@ -72,6 +76,7 @@
uri);
}
+// Coverage-ignore(suite): Not run.
Never unexpected(String expected, String actual, int charOffset, Uri? uri) {
return internalProblem(
templateInternalProblemUnexpected.withArguments(expected, actual),
@@ -79,6 +84,7 @@
uri);
}
+// Coverage-ignore(suite): Not run.
Never unsupported(String operation, int charOffset, Uri? uri) {
return internalProblem(
templateInternalProblemUnsupported.withArguments(operation),
@@ -86,6 +92,7 @@
uri);
}
+// Coverage-ignore(suite): Not run.
Uri? getFileUri(TreeNode node) {
TreeNode? parent = node;
do {
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index fd2de74..e094585 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -96,6 +96,7 @@
/// not been computed yet.
PackageConfig? get _packages => _packageConfigAndUri?.packageConfig;
+ // Coverage-ignore(suite): Not run.
/// Resolve and return [packagesUri].
Future<Uri> resolvePackagesFileUri() async {
await _getPackages();
@@ -145,6 +146,7 @@
List<int>? _sdkSummaryBytes;
bool _triedLoadingSdkSummary = false;
+ // Coverage-ignore(suite): Not run.
/// Get the bytes of the SDK outline, if any.
Future<List<int>?> loadSdkSummaryBytes() async {
if (_sdkSummaryBytes == null && !_triedLoadingSdkSummary) {
@@ -172,6 +174,7 @@
bool get debugDump => _raw.debugDump;
+ // Coverage-ignore(suite): Not run.
bool get debugDumpShowOffsets => _raw.debugDumpShowOffsets;
bool get omitPlatform => _raw.omitPlatform;
@@ -182,12 +185,15 @@
bool get throwOnErrorsForDebugging => _raw.throwOnErrorsForDebugging;
+ // Coverage-ignore(suite): Not run.
bool get throwOnWarningsForDebugging => _raw.throwOnWarningsForDebugging;
+ // Coverage-ignore(suite): Not run.
bool get emitDeps => _raw.emitDeps;
NnbdMode get nnbdMode => _raw.nnbdMode;
+ // Coverage-ignore(suite): Not run.
bool get enableUnscheduledExperiments => _raw.enableUnscheduledExperiments;
bool get hasAdditionalDills => _raw.additionalDills.isNotEmpty;
@@ -206,6 +212,7 @@
int fatalDiagnosticCount = 0;
MacroSerializer? _macroSerializer;
+ // Coverage-ignore(suite): Not run.
MacroSerializer get macroSerializer =>
_macroSerializer ??= _raw.macroSerializer ?? new MacroSerializer();
@@ -244,11 +251,13 @@
{List<LocatedMessage>? context, List<Uri>? involvedFiles}) {
if (command_line_reporting.isHidden(severity)) return;
if (CompilerContext.current.options.setExitCodeOnProblem) {
+ // Coverage-ignore-block(suite): Not run.
exitCode = 1;
}
reportDiagnosticMessage(
format(message, severity, context, involvedFiles: involvedFiles));
if (command_line_reporting.shouldThrowOn(severity)) {
+ // Coverage-ignore-block(suite): Not run.
if (fatalDiagnosticCount++ < _raw.skipForDebugging) {
// Skip this one. The interesting one comes later.
return;
@@ -265,7 +274,8 @@
}
void reportDiagnosticMessage(DiagnosticMessage message) {
- (_raw.onDiagnostic ?? defaultDiagnosticMessageHandler)(message);
+ (_raw.onDiagnostic ?? // Coverage-ignore(suite): Not run.
+ defaultDiagnosticMessageHandler)(message);
}
/// Returns [error] as a message from the OS.
@@ -274,9 +284,11 @@
/// be a fixed string, otherwise the toString of [error] will be returned.
String osErrorMessage(Object? error) {
if (_raw.omitOsMessageForTesting) return '<os-message>';
+ // Coverage-ignore(suite): Not run.
return '$error';
}
+ // Coverage-ignore(suite): Not run.
void defaultDiagnosticMessageHandler(DiagnosticMessage message) {
if (Verbosity.shouldPrint(_raw.verbosity, message)) {
printDiagnosticMessage(message, print);
@@ -292,6 +304,7 @@
/// info message about the null safety compilation mode is emitted.
void reportNullSafetyCompilationModeInfo() {
if (_raw.invocationModes.contains(InvocationMode.compile)) {
+ // Coverage-ignore-block(suite): Not run.
switch (nnbdMode) {
case NnbdMode.Weak:
reportWithoutLocation(messageCompilingWithoutSoundNullSafety,
@@ -314,16 +327,20 @@
_validated = true;
if (verbose) {
+ // Coverage-ignore-block(suite): Not run.
print(debugString());
}
if (errorOnMissingInput && inputs.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
reportWithoutLocation(messageMissingInput, Severity.error);
return false;
}
if (_raw.sdkRoot != null &&
+ // Coverage-ignore(suite): Not run.
!await fileSystem.entityForUri(sdkRoot!).exists()) {
+ // Coverage-ignore-block(suite): Not run.
reportWithoutLocation(
templateSdkRootNotFound.withArguments(sdkRoot!), Severity.error);
return false;
@@ -331,12 +348,14 @@
Uri? summary = sdkSummary;
if (summary != null && !await fileSystem.entityForUri(summary).exists()) {
+ // Coverage-ignore-block(suite): Not run.
reportWithoutLocation(
templateSdkSummaryNotFound.withArguments(summary), Severity.error);
return false;
}
if (compileSdk && summary != null) {
+ // Coverage-ignore-block(suite): Not run.
reportWithoutLocation(
messageInternalProblemProvidedBothCompileSdkAndSdkSummary,
Severity.internalProblem);
@@ -344,6 +363,7 @@
}
for (Uri source in _raw.additionalDills) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(ahe): Remove this check, the compiler itself should handle and
// recover from this.
if (!await fileSystem.entityForUri(source).exists()) {
@@ -359,6 +379,7 @@
bool value = entry.value;
if (experimentalFlag.isExpired &&
value != experimentalFlag.isEnabledByDefault) {
+ // Coverage-ignore-block(suite): Not run.
if (value) {
reportWithoutLocation(
templateExperimentExpiredEnabled
@@ -390,6 +411,7 @@
/// effect.
void clearFileSystemCache() => _fileSystem = null;
+ // Coverage-ignore(suite): Not run.
/// Whether to write a file (e.g. a dill file) when reporting a crash.
bool get writeFileOnCrashReport => _raw.writeFileOnCrashReport;
@@ -400,12 +422,14 @@
Target? _target;
Target get target => _target ??= _raw.target ??
+ // Coverage-ignore(suite): Not run.
new NoneTarget(
new TargetFlags(soundNullSafety: nnbdMode == NnbdMode.Strong));
/// Returns the global state of the experimental features.
flags.GlobalFeatures get globalFeatures => _raw.globalFeatures;
+ // Coverage-ignore(suite): Not run.
/// Returns the minimum language version needed for a library with the given
/// [importUri] to opt into the experiment with the given [flag].
///
@@ -444,6 +468,7 @@
// TODO(sigmund): move, this doesn't feel like an "option".
Future<Component?> loadSdkSummary(CanonicalName? nameRoot) async {
if (_sdkSummaryComponent == null) {
+ // Coverage-ignore-block(suite): Not run.
if (sdkSummary == null) return null;
List<int>? bytes = await loadSdkSummaryBytes();
if (bytes != null && bytes.isNotEmpty) {
@@ -462,6 +487,7 @@
_sdkSummaryComponent = platform;
}
+ // Coverage-ignore(suite): Not run.
/// Get the components for each of the underlying `additionalDill`
/// provided via [CompilerOptions].
// TODO(sigmund): move, this doesn't feel like an "option".
@@ -483,6 +509,7 @@
return _additionalDillComponents!;
}
+ // Coverage-ignore(suite): Not run.
/// Helper to load a .dill file from [uri] using the existing [nameRoot].
Component loadComponent(List<int> bytes, CanonicalName? nameRoot,
{bool? alwaysCreateNewNamedNodes, Uri? fileUri}) {
@@ -503,6 +530,7 @@
/// required to locate/read the packages file as well as SDK metadata.
Future<UriTranslator> getUriTranslator({bool bypassCache = false}) async {
if (bypassCache) {
+ // Coverage-ignore-block(suite): Not run.
_uriTranslator = null;
_packageConfigAndUri = null;
}
@@ -523,12 +551,14 @@
// TODO(sigmund): Eek! We should get to the point where there is no
// fasta-specific targets and the target names are meaningful.
if (name.endsWith('_fasta')) {
+ // Coverage-ignore-block(suite): Not run.
name = name.substring(0, name.length - 6);
}
if (librariesSpecificationUri == null ||
!await fileSystem.entityForUri(librariesSpecificationUri!).exists()) {
if (compileSdk) {
+ // Coverage-ignore-block(suite): Not run.
reportWithoutLocation(
templateSdkSpecificationNotFound
.withArguments(librariesSpecificationUri!),
@@ -542,7 +572,9 @@
librariesSpecificationUri!,
(Uri uri) => fileSystem.entityForUri(uri).readAsString());
return spec.specificationFor(name);
- } on LibrariesSpecificationException catch (e) {
+ }
+ // Coverage-ignore(suite): Not run.
+ on LibrariesSpecificationException catch (e) {
reportWithoutLocation(
templateCannotReadSdkSpecification.withArguments('${e.error}'),
Severity.error);
@@ -556,6 +588,7 @@
/// required to locate/read the packages file.
Future<PackageConfig> _getPackages() async {
if (_packages != null) {
+ // Coverage-ignore-block(suite): Not run.
return _packages!;
}
_packageConfigAndUri = null;
@@ -565,6 +598,7 @@
return _packages!;
}
+ // Coverage-ignore-block(suite): Not run.
if (inputs.isEmpty) {
_packageConfigAndUri = _PackageConfigAndUri.empty;
return _packages!;
@@ -608,13 +642,17 @@
if (fileContents is Uint8List) {
return fileContents;
} else {
+ // Coverage-ignore-block(suite): Not run.
return new Uint8List.fromList(fileContents);
}
- } on FileSystemException catch (e) {
+ }
+ // Coverage-ignore(suite): Not run.
+ on FileSystemException catch (e) {
reportWithoutLocation(
templateCantReadFile.withArguments(uri, osErrorMessage(e.message)),
Severity.error);
} catch (e) {
+ // Coverage-ignore-block(suite): Not run.
Message message = templateExceptionReadingFile.withArguments(uri, '$e');
reportWithoutLocation(message, Severity.error);
// We throw a new exception to ensure that the message include the uri
@@ -637,11 +675,14 @@
Uint8List? contents =
requestedUri == new Uri() ? null : await _readFile(requestedUri);
if (contents == null) {
+ // Coverage-ignore-block(suite): Not run.
return _PackageConfigAndUri.empty;
}
try {
- void Function(Object error) onError = (Object error) {
+ void Function(Object error) onError =
+ // Coverage-ignore(suite): Not run.
+ (Object error) {
if (error is FormatException) {
report(
templatePackagesFileFormat
@@ -658,20 +699,25 @@
return new _PackageConfigAndUri(
PackageConfig.parseBytes(contents, requestedUri, onError: onError),
requestedUri);
- } on FormatException catch (e) {
+ }
+ // Coverage-ignore(suite): Not run.
+ on FormatException catch (e) {
report(
templatePackagesFileFormat
.withArguments(e.message)
.withLocation(requestedUri, e.offset ?? -1, noLength),
Severity.error);
} catch (e) {
+ // Coverage-ignore-block(suite): Not run.
reportWithoutLocation(
templateCantReadFile.withArguments(requestedUri, "$e"),
Severity.error);
}
+ // Coverage-ignore(suite): Not run.
return _PackageConfigAndUri.empty;
}
+ // Coverage-ignore(suite): Not run.
/// Create a [PackageConfig] given the Uri to a `package_config.json` file,
/// and use it in these options.
///
@@ -681,6 +727,7 @@
return _packageConfigAndUri!.packageConfig;
}
+ // Coverage-ignore(suite): Not run.
/// Finds a package resolution strategy using a [FileSystem].
///
/// The [scriptUri] points to a Dart script with a valid scheme accepted by
@@ -753,6 +800,7 @@
_computedSdkDefaults = true;
Uri? root = _raw.sdkRoot;
if (root != null) {
+ // Coverage-ignore-block(suite): Not run.
// Normalize to always end in '/'
if (!root.path.endsWith('/')) {
root = root.replace(path: root.path + '/');
@@ -766,7 +814,9 @@
if (_raw.sdkSummary != null) {
_sdkSummary = _raw.sdkSummary;
- } else if (!compileSdk) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (!compileSdk) {
// Infer based on the sdkRoot, but only when `compileSdk` is false,
// otherwise the default intent was to compile the sdk from sources and
// not to load an sdk summary file.
@@ -776,6 +826,7 @@
if (_raw.librariesSpecificationUri != null) {
_librariesSpecificationUri = _raw.librariesSpecificationUri;
} else if (compileSdk) {
+ // Coverage-ignore-block(suite): Not run.
_librariesSpecificationUri = sdkRoot!.resolve('lib/libraries.json');
}
}
@@ -831,6 +882,7 @@
return '$sb';
}
+ // Coverage-ignore(suite): Not run.
Future<List<int>?> _readAsBytes(FileSystemEntity file) async {
try {
return await file.readAsBytes();
@@ -844,6 +896,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
MultiMacroExecutor get macroExecutor {
if (_raw.macroExecutor != null) return _raw.macroExecutor!;
@@ -886,9 +939,11 @@
return executor;
}
+ // Coverage-ignore(suite): Not run.
SerializationMode get macroSerializationMode =>
_raw.macroSerializationMode ??= SerializationMode.byteData;
+ // Coverage-ignore(suite): Not run.
/// The currently running precompilations.
Set<Uri> get runningPrecompilations => _raw.runningPrecompilations;
@@ -896,15 +951,18 @@
HooksForTesting? get hooksForTesting => _raw.hooksForTesting;
+ // Coverage-ignore(suite): Not run.
bool get showGeneratedMacroSourcesForTesting =>
_raw.showGeneratedMacroSourcesForTesting;
+ // Coverage-ignore(suite): Not run.
/// Disposes macro executor and serializer if configured.
Future<void> dispose() async {
await _raw.macroExecutor?.closeAndReset();
await macroSerializer.close();
}
+ // Coverage-ignore(suite): Not run.
bool equivalent(ProcessedOptions other,
{bool ignoreOnDiagnostic = true,
bool ignoreVerbose = true,
@@ -916,6 +974,7 @@
/// A package config and the `URI` it was loaded from.
class _PackageConfigAndUri {
+ // Coverage-ignore(suite): Not run.
static final _PackageConfigAndUri empty =
new _PackageConfigAndUri(PackageConfig.empty, new Uri());
diff --git a/pkg/front_end/lib/src/base/scope.dart b/pkg/front_end/lib/src/base/scope.dart
index e98497c..985ba93 100644
--- a/pkg/front_end/lib/src/base/scope.dart
+++ b/pkg/front_end/lib/src/base/scope.dart
@@ -346,6 +346,7 @@
}
if (existingGetter == null) {
+ // Coverage-ignore-block(suite): Not run.
// No existing getter.
if (replacementGetterFromSetter != null) {
// We might have had one implicitly from the setter. Use it here,
@@ -358,8 +359,10 @@
// The existing getter should be replaced.
if (replacementGetterFromGetter != null) {
// With a new getter.
- (_local ??= {})[name] = replacementGetterFromGetter;
+ (_local ??= // Coverage-ignore(suite): Not run.
+ {})[name] = replacementGetterFromGetter;
} else {
+ // Coverage-ignore-block(suite): Not run.
// With `null`, i.e. removed. This means that the getter is
// implicitly available through the setter. (This is currently not
// possible, but handled here to match the case for setters below).
@@ -373,16 +376,16 @@
if (replacementSetterFromGetter != null) {
// We might have had one implicitly from the getter. Use it here,
// if so.
- (_setters ??= {})[name] =
- replacementSetterFromGetter as MemberBuilder;
+ (_setters ??= // Coverage-ignore(suite): Not run.
+ {})[name] = replacementSetterFromGetter as MemberBuilder;
}
} else if (existingSetter.parent ==
replacementLibraryBuilderFromSetter) {
// The existing setter should be replaced.
if (replacementSetterFromSetter != null) {
// With a new setter.
- (_setters ??= {})[name] =
- replacementSetterFromSetter as MemberBuilder;
+ (_setters ??= // Coverage-ignore(suite): Not run.
+ {})[name] = replacementSetterFromSetter as MemberBuilder;
} else {
// With `null`, i.e. removed. This means that the setter is
// implicitly available through the getter. This happens when the
@@ -395,6 +398,7 @@
}
}
if (_extensions != null) {
+ // Coverage-ignore-block(suite): Not run.
bool needsPatching = false;
for (ExtensionBuilder extensionBuilder in _extensions!) {
if (replacementMap.containsKey(extensionBuilder.parent)) {
@@ -424,6 +428,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
Scope copyWithParent(Scope parent, String debugName) {
return new Scope(
kind: kind,
@@ -435,6 +440,7 @@
isModifiable: isModifiable);
}
+ // Coverage-ignore(suite): Not run.
/// Don't use this. Use [becomePartOf] instead.
void set parent(_) => unsupported("parent=", -1, null);
@@ -515,8 +521,15 @@
Builder? builder = map[name];
if (builder == null) return null;
if (builder.next != null) {
- return new AmbiguousBuilder(name.isEmpty ? classNameOrDebugName : name,
- builder, charOffset, fileUri);
+ return new AmbiguousBuilder(
+ name.isEmpty
+ ?
+ // Coverage-ignore(suite): Not run.
+ classNameOrDebugName
+ : name,
+ builder,
+ charOffset,
+ fileUri);
} else if (!isInstanceScope && builder.isDeclarationInstanceMember) {
return null;
} else if (builder is MemberBuilder && builder.isConflictingSetter) {
@@ -576,7 +589,8 @@
void addLocalMember(String name, Builder member, {required bool setter}) {
if (setter) {
- (_setters ??= {})[name] = member as MemberBuilder;
+ (_setters ??= // Coverage-ignore(suite): Not run.
+ {})[name] = member as MemberBuilder;
} else {
(_local ??= {})[name] = member;
}
@@ -683,11 +697,13 @@
}
if (scope._local != null) {
- map = _local ??= {};
+ map = _local ??= // Coverage-ignore(suite): Not run.
+ {};
scope._local?.forEach(mergeMember);
}
if (scope._setters != null) {
- map = _setters ??= {};
+ map = _setters ??= // Coverage-ignore(suite): Not run.
+ {};
scope._setters?.forEach(mergeMember);
}
if (scope._extensions != null) {
@@ -704,6 +720,7 @@
return "$buffer";
}
+ // Coverage-ignore(suite): Not run.
int writeOn(StringSink sink) {
int nestingLevel = (_parent?.writeOn(sink) ?? -1) + 1;
String indent = " " * nestingLevel;
@@ -871,6 +888,7 @@
Builder? get parent => builder.parent;
@override
+ // Coverage-ignore(suite): Not run.
bool get isFinal => builder.isFinal;
@override
@@ -902,6 +920,7 @@
bool get isStatic => builder.isStatic;
@override
+ // Coverage-ignore(suite): Not run.
bool get isTopLevel => builder.isTopLevel;
@override
@@ -911,6 +930,7 @@
bool get isLocal => builder.isLocal;
@override
+ // Coverage-ignore(suite): Not run.
Message get message => templateAccessError.withArguments(name);
}
@@ -919,11 +939,13 @@
: super(name, builder, charOffset, fileUri);
@override
+ // Coverage-ignore(suite): Not run.
Builder? get parent => null;
@override
Message get message => templateDuplicatedDeclarationUse.withArguments(name);
+ // Coverage-ignore(suite): Not run.
// TODO(ahe): Also provide context.
Builder getFirstDeclaration() {
@@ -937,33 +959,43 @@
mixin ErroneousMemberBuilderMixin implements SourceMemberBuilder {
@override
+ // Coverage-ignore(suite): Not run.
MemberDataForTesting? get dataForTesting => null;
@override
+ // Coverage-ignore(suite): Not run.
Member get member => throw new UnsupportedError('$runtimeType.member');
@override
+ // Coverage-ignore(suite): Not run.
Name get memberName => throw new UnsupportedError('$runtimeType.memberName');
@override
+ // Coverage-ignore(suite): Not run.
Member? get readTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member? get invokeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => const [];
@override
+ // Coverage-ignore(suite): Not run.
bool get isAssignable => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExternal => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isAbstract => false;
@override
@@ -999,6 +1031,7 @@
// TODO(johnniwinther): Remove this and create a [ProcedureBuilder] interface.
@override
+ // Coverage-ignore(suite): Not run.
ProcedureKind? get kind => null;
@override
@@ -1010,29 +1043,35 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void buildOutlineNodes(BuildNodesCallback f) {
assert(false, "Unexpected call to $runtimeType.buildOutlineNodes.");
}
@override
+ // Coverage-ignore(suite): Not run.
int buildBodyNodes(BuildNodesCallback f) {
assert(false, "Unexpected call to $runtimeType.buildBodyNodes.");
return 0;
}
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get localMembers => const <ClassMember>[];
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get localSetters => const <ClassMember>[];
@override
+ // Coverage-ignore(suite): Not run.
void checkVariance(
SourceClassBuilder sourceClassBuilder, TypeEnvironment typeEnvironment) {
assert(false, "Unexpected call to $runtimeType.checkVariance.");
}
@override
+ // Coverage-ignore(suite): Not run.
void checkTypes(
SourceLibraryBuilder library, TypeEnvironment typeEnvironment) {
assert(false, "Unexpected call to $runtimeType.checkVariance.");
@@ -1124,7 +1163,8 @@
@override
Builder get current {
- return _current ?? (throw new StateError('No element'));
+ return _current ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
}
@@ -1192,7 +1232,8 @@
@override
String get name {
- return _name ?? (throw new StateError('No element'));
+ return _name ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
}
@@ -1222,7 +1263,8 @@
@override
MemberBuilder get current {
- return _current ?? (throw new StateError('No element'));
+ return _current ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
}
@@ -1261,7 +1303,8 @@
@override
String get name {
- return _name ?? (throw new StateError('No element'));
+ return _name ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
}
@@ -1352,6 +1395,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
List<T> toList() {
List<T> list = [];
while (moveNext()) {
@@ -1421,6 +1465,7 @@
? templateNonPatchLibraryConflict.withArguments(name)
: templateNonAugmentationLibraryConflict.withArguments(name);
} else {
+ // Coverage-ignore-block(suite): Not run.
message = inPatchLibrary
? templateNonPatchClassMemberConflict.withArguments(name)
: templateNonAugmentationClassMemberConflict
@@ -1456,7 +1501,9 @@
} else {
message = inPatchLibrary
? templateUnmatchedPatchDeclaration.withArguments(name)
- : templateUnmatchedAugmentationDeclaration.withArguments(name);
+ :
+ // Coverage-ignore(suite): Not run.
+ templateUnmatchedAugmentationDeclaration.withArguments(name);
}
originLibrary.addProblem(
message, newBuilder.charOffset, name.length, newBuilder.fileUri);
@@ -1617,7 +1664,9 @@
inPatchLibrary
? templateNonPatchConstructorConflict
.withArguments(newConstructor.fullNameForErrors)
- : templateNonAugmentationConstructorConflict
+ :
+ // Coverage-ignore(suite): Not run.
+ templateNonAugmentationConstructorConflict
.withArguments(newConstructor.fullNameForErrors),
newConstructor.charOffset,
noLength,
@@ -1635,7 +1684,9 @@
inPatchLibrary
? templateUnmatchedPatchConstructor
.withArguments(newConstructor.fullNameForErrors)
- : templateUnmatchedAugmentationConstructor
+ :
+ // Coverage-ignore(suite): Not run.
+ templateUnmatchedAugmentationConstructor
.withArguments(newConstructor.fullNameForErrors),
newConstructor.charOffset,
noLength,
@@ -1644,6 +1695,7 @@
_originConstructorScope.addLocalMember(name, newConstructor);
for (ConstructorScope augmentationConstructorScope
in _augmentationConstructorScopes.values) {
+ // Coverage-ignore-block(suite): Not run.
_addConstructorToAugmentationScope(
augmentationConstructorScope, name, newConstructor);
}
@@ -1651,6 +1703,7 @@
if (inPatchLibrary &&
!name.startsWith('_') &&
!_allowInjectedPublicMember(newConstructor)) {
+ // Coverage-ignore-block(suite): Not run.
originLibrary.addProblem(
templatePatchInjectionFailed.withArguments(
name, originLibrary.importUri),
@@ -1694,6 +1747,7 @@
return true;
}
if (newBuilder.isStatic) {
+ // Coverage-ignore-block(suite): Not run.
return _origin.name.startsWith('_');
}
// TODO(johnniwinther): Restrict the use of injected public class members.
@@ -1705,6 +1759,7 @@
bool get isAugmentation {
Builder self = this;
if (self is SourceLibraryBuilder) {
+ // Coverage-ignore-block(suite): Not run.
return self.isAugmentationLibrary;
} else if (self is SourceClassBuilder) {
return self.isAugmentation;
@@ -1758,6 +1813,7 @@
} else if (self is SourceExtensionBuilder) {
return _hasPatchAnnotation(self.metadata);
} else if (self is SourceExtensionTypeDeclarationBuilder) {
+ // Coverage-ignore-block(suite): Not run.
return _hasPatchAnnotation(self.metadata);
}
return false;
@@ -1777,6 +1833,7 @@
if (_current != null) {
return _current!.current;
}
+ // Coverage-ignore-block(suite): Not run.
throw new StateError("No current element");
}
diff --git a/pkg/front_end/lib/src/base/ticker.dart b/pkg/front_end/lib/src/base/ticker.dart
index 35b1ac5..07201c1 100644
--- a/pkg/front_end/lib/src/base/ticker.dart
+++ b/pkg/front_end/lib/src/base/ticker.dart
@@ -16,7 +16,9 @@
}
void logMs(Object message) {
- log((Duration elapsed, Duration sinceStart) {
+ log(
+ // Coverage-ignore(suite): Not run.
+ (Duration elapsed, Duration sinceStart) {
print("$sinceStart: $message in ${elapsed.inMilliseconds}ms.");
});
}
@@ -25,6 +27,7 @@
Duration elapsed = sw.elapsed;
try {
if (isVerbose) {
+ // Coverage-ignore-block(suite): Not run.
f(elapsed - previousTick, elapsed);
}
} finally {
diff --git a/pkg/front_end/lib/src/base/uri_translator.dart b/pkg/front_end/lib/src/base/uri_translator.dart
index 7143f38..be84e6a 100644
--- a/pkg/front_end/lib/src/base/uri_translator.dart
+++ b/pkg/front_end/lib/src/base/uri_translator.dart
@@ -21,6 +21,7 @@
List<Uri>? getDartPatches(String libraryName) =>
dartLibraries.libraryInfoFor(libraryName)?.patches;
+ // Coverage-ignore(suite): Not run.
bool isPlatformImplementation(Uri uri) {
if (!uri.isScheme("dart")) return false;
String path = uri.path;
@@ -67,7 +68,9 @@
: _packageUriNotFoundNoReport)(uri);
}
return translated;
- } on ArgumentError catch (e) {
+ }
+ // Coverage-ignore(suite): Not run.
+ on ArgumentError catch (e) {
// TODO(sigmund): catch a more precise error when
// https://github.com/dart-lang/package_config/issues/40 is fixed.
if (reportMessage) {
@@ -88,6 +91,7 @@
return null;
}
+ // Coverage-ignore(suite): Not run.
static Uri? _packageUriNotFoundNoReport(Uri uri) {
return null;
}
diff --git a/pkg/front_end/lib/src/base/uris.dart b/pkg/front_end/lib/src/base/uris.dart
index b6191c6..0ae4242 100644
--- a/pkg/front_end/lib/src/base/uris.dart
+++ b/pkg/front_end/lib/src/base/uris.dart
@@ -64,7 +64,9 @@
Uri getPartUri(Uri parentUri, LibraryPart part) {
try {
return parentUri.resolve(part.partUri);
- } on FormatException {
+ }
+ // Coverage-ignore(suite): Not run.
+ on FormatException {
// This is also done in [SourceLibraryBuilder.resolve]
return new Uri(
scheme: MALFORMED_URI_SCHEME,
diff --git a/pkg/front_end/lib/src/builder/augmentation_iterator.dart b/pkg/front_end/lib/src/builder/augmentation_iterator.dart
index 2389b44..c597b66 100644
--- a/pkg/front_end/lib/src/builder/augmentation_iterator.dart
+++ b/pkg/front_end/lib/src/builder/augmentation_iterator.dart
@@ -1,3 +1,4 @@
+// Coverage-ignore(suite): Not run.
// 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.
diff --git a/pkg/front_end/lib/src/builder/builder.dart b/pkg/front_end/lib/src/builder/builder.dart
index dd29471..ea554d0 100644
--- a/pkg/front_end/lib/src/builder/builder.dart
+++ b/pkg/front_end/lib/src/builder/builder.dart
@@ -274,9 +274,11 @@
bool get hasProblem => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isConst => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isConstructor => false;
@override
@@ -286,6 +288,7 @@
bool get isField => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isFinal => false;
@override
@@ -295,15 +298,19 @@
bool get isExtension => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isDeclarationMember => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isClassMember => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExtensionMember => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExtensionTypeMember => false;
@override
@@ -337,15 +344,18 @@
bool get isSetter => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isStatic => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExternal => false;
@override
bool get isSynthetic => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isTopLevel => false;
@override
@@ -355,6 +365,7 @@
bool get isTypeVariable => false;
@override
+ // Coverage-ignore(suite): Not run.
void applyAugmentation(Builder augmentation) {
unsupported("${runtimeType}.applyAugmentation", charOffset, fileUri);
}
diff --git a/pkg/front_end/lib/src/builder/builtin_type_declaration_builder.dart b/pkg/front_end/lib/src/builder/builtin_type_declaration_builder.dart
index 12d22e4..fef0866 100644
--- a/pkg/front_end/lib/src/builder/builtin_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/builtin_type_declaration_builder.dart
@@ -30,6 +30,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType buildAliasedTypeWithBuiltArguments(
LibraryBuilder library,
Nullability nullability,
diff --git a/pkg/front_end/lib/src/builder/class_builder.dart b/pkg/front_end/lib/src/builder/class_builder.dart
index 083b303..58efb80 100644
--- a/pkg/front_end/lib/src/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/builder/class_builder.dart
@@ -204,7 +204,9 @@
@override
bool get isAnonymousMixinApplication {
- return isMixinApplication && !isNamedMixinApplication;
+ return isMixinApplication &&
+ // Coverage-ignore(suite): Not run.
+ !isNamedMixinApplication;
}
@override
@@ -236,6 +238,7 @@
{bool setter = false, bool required = false}) {
Builder? builder = scope.lookupLocalMember(name, setter: setter);
if (builder == null && isAugmenting) {
+ // Coverage-ignore-block(suite): Not run.
builder = origin.scope.lookupLocalMember(name, setter: setter);
}
if (required && builder == null) {
@@ -271,6 +274,7 @@
getAsTypeArguments(cls.typeParameters, libraryBuilder.library));
}
+ // Coverage-ignore(suite): Not run.
InterfaceType get legacyRawType {
return _legacyRawType ??= new InterfaceType(cls, Nullability.legacy,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
@@ -291,11 +295,13 @@
InterfaceType rawType(Nullability nullability) {
switch (nullability) {
case Nullability.legacy:
+ // Coverage-ignore(suite): Not run.
return legacyRawType;
case Nullability.nullable:
return nullableRawType;
case Nullability.nonNullable:
return nonNullableRawType;
+ // Coverage-ignore(suite): Not run.
case Nullability.undetermined:
return unhandled("$nullability", "rawType", TreeNode.noOffset, noUri);
}
@@ -329,13 +335,17 @@
return rawType(nullability);
}
if (aliasedTypeWithBuiltArgumentsCacheNonNullable != null &&
+ // Coverage-ignore(suite): Not run.
nullability == Nullability.nonNullable) {
+ // Coverage-ignore-block(suite): Not run.
assert(aliasedTypeWithBuiltArgumentsCacheNonNullable!.classReference ==
cls.reference);
assert(arguments.isEmpty);
return aliasedTypeWithBuiltArgumentsCacheNonNullable!;
} else if (aliasedTypeWithBuiltArgumentsCacheNullable != null &&
+ // Coverage-ignore(suite): Not run.
nullability == Nullability.nullable) {
+ // Coverage-ignore-block(suite): Not run.
assert(aliasedTypeWithBuiltArgumentsCacheNullable!.classReference ==
cls.reference);
assert(arguments.isEmpty);
@@ -343,6 +353,7 @@
}
InterfaceType type = new InterfaceType(cls, nullability, arguments);
if (arguments.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeVariablesCount == 0);
if (nullability == Nullability.nonNullable) {
aliasedTypeWithBuiltArgumentsCacheNonNullable = type;
@@ -373,6 +384,7 @@
libraryBuilder.importUri.path == "core" &&
library is SourceLibraryBuilder &&
!isRecordAccessAllowed(library)) {
+ // Coverage-ignore-block(suite): Not run.
library.reportFeatureNotEnabled(
library.libraryFeatures.records, fileUri, charOffset, name.length);
return const InvalidType();
@@ -390,7 +402,11 @@
@override
Supertype buildMixedInType(
LibraryBuilder library, List<TypeBuilder>? arguments) {
- Class cls = isAugmenting ? origin.cls : this.cls;
+ Class cls = isAugmenting
+ ?
+ // Coverage-ignore(suite): Not run.
+ origin.cls
+ : this.cls;
if (arguments != null) {
List<DartType> typeArguments =
buildAliasedTypeArguments(library, arguments, /* hierarchy = */ null);
@@ -418,6 +434,7 @@
{bool isSetter = false, bool isSuper = false}) {
Class? instanceClass = cls;
if (isAugmenting) {
+ // Coverage-ignore-block(suite): Not run.
assert(identical(instanceClass, origin.cls),
"Found ${origin.cls} expected $instanceClass");
if (isSuper) {
@@ -442,7 +459,9 @@
}
Member? target = isSuper
? hierarchy.getDispatchTarget(instanceClass, name, setter: isSetter)
- : hierarchy.getInterfaceMember(instanceClass, name, setter: isSetter);
+ :
+ // Coverage-ignore(suite): Not run.
+ hierarchy.getInterfaceMember(instanceClass, name, setter: isSetter);
if (isSuper && target == null) {
if (cls.isMixinDeclaration) {
target =
diff --git a/pkg/front_end/lib/src/builder/fixed_type_builder.dart b/pkg/front_end/lib/src/builder/fixed_type_builder.dart
index 998435e..4882626 100644
--- a/pkg/front_end/lib/src/builder/fixed_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/fixed_type_builder.dart
@@ -21,6 +21,7 @@
const FixedTypeBuilderImpl(this.type, this.fileUri, this.charOffset);
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder clone(
List<NamedTypeBuilder> newTypes,
SourceLibraryBuilder contextLibrary,
@@ -29,9 +30,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TypeName? get typeName => null;
@override
+ // Coverage-ignore(suite): Not run.
NullabilityBuilder get nullabilityBuilder =>
new NullabilityBuilder.fromNullability(type.nullability);
@@ -39,9 +42,11 @@
String get debugName => 'FixedTypeBuilder';
@override
+ // Coverage-ignore(suite): Not run.
bool get isVoidType => type is VoidType;
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
buffer.write('type=${type}');
return buffer;
@@ -60,21 +65,25 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Supertype buildSupertype(LibraryBuilder library, TypeUse typeUse) {
return unhandled(
'buildSupertype', 'FixedTypeBuilder', charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
Supertype buildMixedInType(LibraryBuilder library) {
return unhandled(
'buildMixedInType', 'FixedTypeBuilder', charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder withNullabilityBuilder(NullabilityBuilder nullabilityBuilder) =>
this;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExplicit => true;
}
diff --git a/pkg/front_end/lib/src/builder/formal_parameter_builder.dart b/pkg/front_end/lib/src/builder/formal_parameter_builder.dart
index bb15a6f..a2a4f52 100644
--- a/pkg/front_end/lib/src/builder/formal_parameter_builder.dart
+++ b/pkg/front_end/lib/src/builder/formal_parameter_builder.dart
@@ -153,6 +153,7 @@
!isSuperInitializingFormal;
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors => name;
VariableDeclaration build(SourceLibraryBuilder library) {
@@ -319,6 +320,7 @@
FunctionTypeParameterBuilder(this.kind, this.type, this.name);
@override
+ // Coverage-ignore(suite): Not run.
ParameterBuilder clone(
List<NamedTypeBuilder> newTypes,
SourceLibraryBuilder contextLibrary,
diff --git a/pkg/front_end/lib/src/builder/function_type_builder.dart b/pkg/front_end/lib/src/builder/function_type_builder.dart
index 174abdd..6abd7e3 100644
--- a/pkg/front_end/lib/src/builder/function_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/function_type_builder.dart
@@ -72,7 +72,9 @@
fileUri,
charOffset,
hasFunctionFormalParameterSyntax)
- : new _InferredFunctionTypeBuilder(
+ :
+ // Coverage-ignore(suite): Not run.
+ new _InferredFunctionTypeBuilder(
returnType,
typeVariables,
formals,
@@ -98,11 +100,13 @@
String get debugName => "Function";
@override
+ // Coverage-ignore(suite): Not run.
bool get isVoidType => false;
@override
StringBuffer printOn(StringBuffer buffer) {
if (typeVariables != null) {
+ // Coverage-ignore-block(suite): Not run.
buffer.write("<");
bool isFirst = true;
for (StructuralVariableBuilder t in typeVariables!) {
@@ -117,6 +121,7 @@
}
buffer.write("(");
if (formals != null) {
+ // Coverage-ignore-block(suite): Not run.
bool isFirst = true;
for (ParameterBuilder t in formals!) {
if (!isFirst) {
@@ -143,7 +148,9 @@
@override
DartType buildAliased(
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
- assert(hierarchy != null || isExplicit, "Cannot build $this.");
+ assert(
+ hierarchy != null || isExplicit, // Coverage-ignore(suite): Not run.
+ "Cannot build $this.");
DartType builtReturnType =
returnType.buildAliased(library, TypeUse.returnType, hierarchy);
List<DartType> positionalParameters = <DartType>[];
@@ -258,6 +265,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// A function type that needs type inference to be fully defined.
///
/// This occurs through macros where return type or parameter types can be
diff --git a/pkg/front_end/lib/src/builder/future_or_type_declaration_builder.dart b/pkg/front_end/lib/src/builder/future_or_type_declaration_builder.dart
index 9111653..64892d5 100644
--- a/pkg/front_end/lib/src/builder/future_or_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/future_or_type_declaration_builder.dart
@@ -12,6 +12,7 @@
import 'nullability_builder.dart';
import 'type_builder.dart';
+// Coverage-ignore(suite): Not run.
class FutureOrTypeDeclarationBuilder extends BuiltinTypeDeclarationBuilder {
FutureOrTypeDeclarationBuilder(
DartType type, LibraryBuilder compilationUnit, int charOffset)
diff --git a/pkg/front_end/lib/src/builder/invalid_type_builder.dart b/pkg/front_end/lib/src/builder/invalid_type_builder.dart
index c80a069..11cd26a 100644
--- a/pkg/front_end/lib/src/builder/invalid_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/invalid_type_builder.dart
@@ -36,16 +36,19 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Supertype? buildMixedInType(LibraryBuilder library) {
return null;
}
@override
+ // Coverage-ignore(suite): Not run.
Supertype? buildSupertype(LibraryBuilder library, TypeUse typeUse) {
return null;
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder clone(
List<NamedTypeBuilder> newTypes,
SourceLibraryBuilder contextLibrary,
@@ -60,19 +63,24 @@
bool get isExplicit => true;
@override
+ // Coverage-ignore(suite): Not run.
bool get isVoidType => false;
@override
+ // Coverage-ignore(suite): Not run.
TypeName? get typeName => null;
@override
+ // Coverage-ignore(suite): Not run.
NullabilityBuilder get nullabilityBuilder =>
const NullabilityBuilder.inherent();
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) => buffer;
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder withNullabilityBuilder(NullabilityBuilder nullabilityBuilder) {
return this;
}
diff --git a/pkg/front_end/lib/src/builder/invalid_type_declaration_builder.dart b/pkg/front_end/lib/src/builder/invalid_type_declaration_builder.dart
index d112904..3583db3 100644
--- a/pkg/front_end/lib/src/builder/invalid_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/invalid_type_declaration_builder.dart
@@ -21,6 +21,7 @@
: super(null, 0, name, null, message.charOffset);
@override
+ // Coverage-ignore(suite): Not run.
Uri? get fileUri => message.uri;
@override
diff --git a/pkg/front_end/lib/src/builder/library_builder.dart b/pkg/front_end/lib/src/builder/library_builder.dart
index 1b98ac2..d6b884e 100644
--- a/pkg/front_end/lib/src/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/builder/library_builder.dart
@@ -401,9 +401,11 @@
: super(null, -1);
@override
+ // Coverage-ignore(suite): Not run.
bool get isSynthetic => false;
@override
+ // Coverage-ignore(suite): Not run.
Builder? get parent => null;
@override
@@ -416,6 +418,7 @@
Loader get loader;
@override
+ // Coverage-ignore(suite): Not run.
int get modifiers => 0;
@override
@@ -491,6 +494,7 @@
Builder? cls = (bypassLibraryPrivacy ? scope : exportScope)
.lookup(className, -1, fileUri);
if (cls is TypeAliasBuilder) {
+ // Coverage-ignore-block(suite): Not run.
TypeAliasBuilder aliasBuilder = cls;
// No type arguments are available, but this method is only called in
// order to find constructors of specific non-generic classes (errors),
@@ -508,10 +512,13 @@
if (!cls.isAbstract) {
return constructor;
}
- } else if (constructor.isFactory) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (constructor.isFactory) {
return constructor;
}
}
+ // Coverage-ignore-block(suite): Not run.
throw internalProblem(
templateInternalProblemConstructorNotFound.withArguments(
"$className.$constructorName", importUri),
@@ -537,6 +544,7 @@
CompilationUnit accessor, int charOffset, int length, Uri fileUri) {}
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
return buffer..write(isPart || isAugmenting ? fileUri : importUri);
}
diff --git a/pkg/front_end/lib/src/builder/member_builder.dart b/pkg/front_end/lib/src/builder/member_builder.dart
index d30fe44..c4f14e7 100644
--- a/pkg/front_end/lib/src/builder/member_builder.dart
+++ b/pkg/front_end/lib/src/builder/member_builder.dart
@@ -251,6 +251,7 @@
bool get isProperty => memberKind != ClassMemberKind.Method;
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get declarations =>
throw new UnsupportedError("$runtimeType.declarations");
diff --git a/pkg/front_end/lib/src/builder/metadata_builder.dart b/pkg/front_end/lib/src/builder/metadata_builder.dart
index 3994457..aef335d 100644
--- a/pkg/front_end/lib/src/builder/metadata_builder.dart
+++ b/pkg/front_end/lib/src/builder/metadata_builder.dart
@@ -32,6 +32,7 @@
: charOffset = _beginToken.charOffset,
hasPatch = _beginToken.next?.lexeme == 'patch';
+ // Coverage-ignore(suite): Not run.
Token? get beginToken => _beginToken;
static void buildAnnotations(
@@ -94,6 +95,7 @@
cloner ??= new CloneVisitorNotMembers();
Expression annotation =
cloner.cloneInContext(annotationBuilder._expression!);
+ // Coverage-ignore(suite): Not run.
if (createFileUriExpression && annotation is! FileUriExpression) {
annotation = new FileUriExpression(annotation, fileUri)
..fileOffset = annotationBuilder.charOffset;
diff --git a/pkg/front_end/lib/src/builder/modifier_builder.dart b/pkg/front_end/lib/src/builder/modifier_builder.dart
index 10207d7..0e0bb45 100644
--- a/pkg/front_end/lib/src/builder/modifier_builder.dart
+++ b/pkg/front_end/lib/src/builder/modifier_builder.dart
@@ -34,6 +34,7 @@
@override
bool get isAugment => (modifiers & augmentMask) != 0;
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
return buffer..write(name);
}
diff --git a/pkg/front_end/lib/src/builder/named_type_builder.dart b/pkg/front_end/lib/src/builder/named_type_builder.dart
index 59a7de5..4461f4f 100644
--- a/pkg/front_end/lib/src/builder/named_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/named_type_builder.dart
@@ -136,7 +136,9 @@
fileUri: fileUri,
charOffset: charOffset,
instanceTypeVariableAccess: instanceTypeVariableAccess)
- : new _InferredNamedTypeBuilder(name, nullabilityBuilder,
+ :
+ // Coverage-ignore(suite): Not run.
+ new _InferredNamedTypeBuilder(name, nullabilityBuilder,
arguments: arguments,
fileUri: fileUri,
charOffset: charOffset,
@@ -293,6 +295,7 @@
message.withLocation(fileUri!, nameOffset, nameLength));
return;
case InstanceTypeVariableAccessState.Unexpected:
+ // Coverage-ignore(suite): Not run.
assert(false,
"Unexpected instance type variable $typeParameterBuilder");
break;
@@ -315,6 +318,7 @@
bool first = true;
for (TypeBuilder t in typeArguments) {
if (!first) {
+ // Coverage-ignore-block(suite): Not run.
buffer.write(", ");
}
first = false;
@@ -352,6 +356,7 @@
Message message;
if (declaration!.isTypeVariable) {
+ // Coverage-ignore-block(suite): Not run.
message =
templateSupertypeIsTypeVariable.withArguments(fullNameForErrors);
} else if (type.nullability == Nullability.nullable) {
@@ -376,31 +381,36 @@
messageExtendsDeferredClass,
typeName.fullNameOffset,
typeName.fullNameLength,
- fileUri ?? libraryBuilder.fileUri);
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ libraryBuilder.fileUri);
case TypeUse.classImplementsType:
libraryBuilder.addProblem(
messageClassImplementsDeferredClass,
typeName.fullNameOffset,
typeName.fullNameLength,
- fileUri ?? libraryBuilder.fileUri);
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ libraryBuilder.fileUri);
case TypeUse.mixinOnType:
libraryBuilder.addProblem(
messageMixinSuperClassConstraintDeferredClass,
typeName.fullNameOffset,
typeName.fullNameLength,
- fileUri ?? libraryBuilder.fileUri);
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ libraryBuilder.fileUri);
case TypeUse.extensionTypeImplementsType:
libraryBuilder.addProblem(
messageExtensionTypeImplementsDeferred,
typeName.fullNameOffset,
typeName.fullNameLength,
- fileUri ?? libraryBuilder.fileUri);
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ libraryBuilder.fileUri);
case TypeUse.classWithType:
libraryBuilder.addProblem(
messageMixinDeferredMixin,
typeName.fullNameOffset,
typeName.fullNameLength,
- fileUri ?? libraryBuilder.fileUri);
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ libraryBuilder.fileUri);
case TypeUse.literalTypeArgument:
case TypeUse.variableType:
case TypeUse.typeParameterBound:
@@ -419,13 +429,21 @@
case TypeUse.typeLiteral:
case TypeUse.extensionOnType:
case TypeUse.extensionTypeRepresentationType:
+ // Coverage-ignore(suite): Not run.
case TypeUse.typeArgument:
+ // Coverage-ignore(suite): Not run.
case TypeUse.typedefAlias:
+ // Coverage-ignore(suite): Not run.
case TypeUse.instantiation:
+ // Coverage-ignore(suite): Not run.
case TypeUse.enumSelfType:
+ // Coverage-ignore(suite): Not run.
case TypeUse.macroTypeArgument:
+ // Coverage-ignore(suite): Not run.
case TypeUse.typeParameterDefaultType:
+ // Coverage-ignore(suite): Not run.
case TypeUse.defaultTypeAsTypeArgument:
+ // Coverage-ignore(suite): Not run.
case TypeUse.deferredTypeError:
}
}
@@ -438,7 +456,9 @@
if (libraryBuilder is SourceLibraryBuilder) {
_checkDeferred(libraryBuilder, typeUse);
if (!isRecordAccessAllowed(libraryBuilder) &&
+ // Coverage-ignore(suite): Not run.
isDartCoreRecord(aliasedType)) {
+ // Coverage-ignore-block(suite): Not run.
libraryBuilder.reportFeatureNotEnabled(
libraryBuilder.libraryFeatures.records,
fileUri ?? libraryBuilder.fileUri,
@@ -454,7 +474,9 @@
{Set<TypeAliasBuilder>? usedTypeAliasBuilders,
List<TypeBuilder>? unboundTypes,
List<StructuralVariableBuilder>? unboundTypeVariables}) {
- assert(declaration != null, "Declaration has not been resolved on $this.");
+ assert(
+ declaration != null, // Coverage-ignore(suite): Not run.
+ "Declaration has not been resolved on $this.");
if (declaration is TypeAliasBuilder) {
return (declaration as TypeAliasBuilder).unalias(typeArguments,
usedTypeAliasBuilders: usedTypeAliasBuilders,
@@ -467,11 +489,15 @@
@override
DartType buildAliased(
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
- assert(hierarchy != null || isExplicit, "Cannot build $this.");
+ assert(
+ hierarchy != null || isExplicit, // Coverage-ignore(suite): Not run.
+ "Cannot build $this.");
DartType builtType = _buildAliasedInternal(library, typeUse, hierarchy);
if (library is SourceLibraryBuilder &&
!isRecordAccessAllowed(library) &&
+ // Coverage-ignore(suite): Not run.
isDartCoreRecord(builtType)) {
+ // Coverage-ignore-block(suite): Not run.
library.reportFeatureNotEnabled(
library.libraryFeatures.records,
fileUri ?? library.fileUri,
@@ -484,7 +510,9 @@
DartType _buildAliasedInternal(
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
- assert(declaration != null, "Declaration has not been resolved on $this.");
+ assert(
+ declaration != null, // Coverage-ignore(suite): Not run.
+ "Declaration has not been resolved on $this.");
return declaration!.buildAliasedType(
library,
nullabilityBuilder,
@@ -502,6 +530,7 @@
switch (declaration) {
case ClassBuilder():
if (declaration.isNullClass) {
+ // Coverage-ignore-block(suite): Not run.
if (!library.mayImplementRestrictedTypes) {
library.addProblem(
templateExtendingRestricted.withArguments(declaration.name),
@@ -513,7 +542,9 @@
DartType type = build(library, typeUse);
if (type is InterfaceType) {
return new Supertype(type.classNode, type.typeArguments);
- } else if (type is FutureOrType) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (type is FutureOrType) {
return new Supertype(declaration.cls, [type.typeArgument]);
} else if (type is NullType) {
return new Supertype(declaration.cls, []);
@@ -524,6 +555,7 @@
if (type is InterfaceType && type.nullability != Nullability.nullable) {
return new Supertype(type.classNode, type.typeArguments);
} else if (type is NullType) {
+ // Coverage-ignore-block(suite): Not run.
// Even though `Null` is disallowed as a supertype,
// [ClassHierarchyBuilder] still expects it to be built to the
// respective [InterfaceType] referencing the deprecated class.
@@ -544,6 +576,7 @@
return new Supertype(
(unaliasedDeclaration as ClassBuilder).cls, const <DartType>[]);
} else if (type is FutureOrType) {
+ // Coverage-ignore-block(suite): Not run.
// Even though `FutureOr` is disallowed as a supertype,
// [ClassHierarchyBuilder] still expects it to be built to the
// respective [InterfaceType] referencing the deprecated class. In
@@ -580,6 +613,7 @@
case ExtensionTypeDeclarationBuilder():
case ExtensionBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
}
@@ -616,6 +650,7 @@
case ExtensionBuilder():
case ExtensionTypeDeclarationBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
}
@@ -757,6 +792,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// A named type that needs type inference to be fully defined.
///
/// This occurs through macros where type arguments can be defined in terms of
diff --git a/pkg/front_end/lib/src/builder/never_type_declaration_builder.dart b/pkg/front_end/lib/src/builder/never_type_declaration_builder.dart
index 2bbd6b3..4a2ebf7 100644
--- a/pkg/front_end/lib/src/builder/never_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/never_type_declaration_builder.dart
@@ -38,6 +38,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType buildAliasedTypeWithBuiltArguments(
LibraryBuilder library,
Nullability nullability,
diff --git a/pkg/front_end/lib/src/builder/null_type_declaration_builder.dart b/pkg/front_end/lib/src/builder/null_type_declaration_builder.dart
index 9b266f8..e01ce13 100644
--- a/pkg/front_end/lib/src/builder/null_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/null_type_declaration_builder.dart
@@ -22,6 +22,7 @@
String get debugName => "NullTypeBuilder";
@override
+ // Coverage-ignore(suite): Not run.
DartType buildAliasedType(
LibraryBuilder library,
NullabilityBuilder nullabilityBuilder,
@@ -35,6 +36,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType buildAliasedTypeWithBuiltArguments(
LibraryBuilder library,
Nullability nullability,
diff --git a/pkg/front_end/lib/src/builder/omitted_type_builder.dart b/pkg/front_end/lib/src/builder/omitted_type_builder.dart
index 63795c1..c5ca674 100644
--- a/pkg/front_end/lib/src/builder/omitted_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/omitted_type_builder.dart
@@ -26,6 +26,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int? get charOffset => null;
@override
@@ -37,19 +38,24 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Uri? get fileUri => null;
@override
+ // Coverage-ignore(suite): Not run.
bool get isVoidType => false;
@override
+ // Coverage-ignore(suite): Not run.
TypeName? get typeName => null;
@override
+ // Coverage-ignore(suite): Not run.
NullabilityBuilder get nullabilityBuilder =>
const NullabilityBuilder.omitted();
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder withNullabilityBuilder(NullabilityBuilder nullabilityBuilder) {
return this;
}
@@ -85,12 +91,14 @@
String get debugName => 'ImplicitTypeBuilder';
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) => buffer;
@override
bool get isExplicit => true;
@override
+ // Coverage-ignore(suite): Not run.
bool get hasType => true;
@override
@@ -121,6 +129,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType buildAliased(
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
if (hierarchy != null) {
@@ -140,12 +149,14 @@
Inferable? _inferable;
+ // Coverage-ignore(suite): Not run.
Inferable? get inferable => _inferable;
@override
void registerInferable(Inferable inferable) {
assert(
_inferable == null,
+ // Coverage-ignore(suite): Not run.
"Inferable $_inferable has already been register, "
"trying to register $inferable.");
_inferable = inferable;
@@ -164,7 +175,9 @@
} else {
registerInferredType(const DynamicType());
}
- assert(hasType, "No type computed for $this");
+ assert(
+ hasType, // Coverage-ignore(suite): Not run.
+ "No type computed for $this");
}
return type;
}
@@ -173,6 +186,7 @@
String get debugName => 'InferredTypeBuilder';
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
buffer.write('(inferable=');
buffer.write(inferable);
@@ -181,6 +195,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// A type defined in terms of another omitted type.
///
/// This is used in macro generated code to create type annotations from
diff --git a/pkg/front_end/lib/src/builder/omitted_type_declaration_builder.dart b/pkg/front_end/lib/src/builder/omitted_type_declaration_builder.dart
index 0dbc280..a2fb618 100644
--- a/pkg/front_end/lib/src/builder/omitted_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/omitted_type_declaration_builder.dart
@@ -4,6 +4,7 @@
part of 'declaration_builders.dart';
+// Coverage-ignore(suite): Not run.
/// [TypeDeclaration] wrapper for an [OmittedTypeBuilder].
///
/// This is used in macro generated code to create type annotations from
diff --git a/pkg/front_end/lib/src/builder/prefix_builder.dart b/pkg/front_end/lib/src/builder/prefix_builder.dart
index 2ff8d71..a889b7e 100644
--- a/pkg/front_end/lib/src/builder/prefix_builder.dart
+++ b/pkg/front_end/lib/src/builder/prefix_builder.dart
@@ -62,6 +62,7 @@
exportScope.lookupLocalMember(name, setter: member.isSetter);
Builder result;
if (existing != null) {
+ // Coverage-ignore-block(suite): Not run.
result = parent.computeAmbiguousDeclaration(
name, existing, member, charOffset,
isExport: true);
@@ -75,5 +76,6 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors => name;
}
diff --git a/pkg/front_end/lib/src/builder/record_type_builder.dart b/pkg/front_end/lib/src/builder/record_type_builder.dart
index 06f5a46..6cc1086 100644
--- a/pkg/front_end/lib/src/builder/record_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/record_type_builder.dart
@@ -63,7 +63,9 @@
return isExplicit
? new _ExplicitRecordTypeBuilder(
positional, named, nullabilityBuilder, fileUri, charOffset)
- : new _InferredRecordTypeBuilder(
+ :
+ // Coverage-ignore(suite): Not run.
+ new _InferredRecordTypeBuilder(
positional, named, nullabilityBuilder, fileUri, charOffset);
}
@@ -71,12 +73,14 @@
this.nullabilityBuilder, this.fileUri, this.charOffset);
@override
+ // Coverage-ignore(suite): Not run.
TypeName? get typeName => null;
@override
String get debugName => "Record";
@override
+ // Coverage-ignore(suite): Not run.
bool get isVoidType => false;
@override
@@ -92,12 +96,14 @@
}
field.type.printOn(buffer);
if (field.name != null) {
+ // Coverage-ignore-block(suite): Not run.
buffer.write(" ");
buffer.write(field.name);
}
}
}
if (namedFields != null) {
+ // Coverage-ignore-block(suite): Not run.
if (!isFirst) {
buffer.write(", ");
}
@@ -131,7 +137,9 @@
@override
DartType buildAliased(
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
- assert(hierarchy != null || isExplicit, "Cannot build $this.");
+ assert(
+ hierarchy != null || isExplicit, // Coverage-ignore(suite): Not run.
+ "Cannot build $this.");
const List<String> forbiddenObjectMemberNames = [
"noSuchMethod",
"toString",
@@ -264,6 +272,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Supertype? buildSupertype(LibraryBuilder library, TypeUse typeUse) {
library.addProblem(
messageSupertypeIsFunction, charOffset, noLength, fileUri);
@@ -271,6 +280,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Supertype? buildMixedInType(LibraryBuilder library) {
return buildSupertype(library, TypeUse.classWithType);
}
@@ -290,6 +300,7 @@
}
List<RecordTypeFieldBuilder>? clonedNamed;
if (namedFields != null) {
+ // Coverage-ignore-block(suite): Not run.
clonedNamed = new List<RecordTypeFieldBuilder>.generate(
namedFields!.length, (int i) {
RecordTypeFieldBuilder entry = namedFields![i];
@@ -334,6 +345,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// A record type that needs type inference to be fully defined.
///
/// This occurs through macros where field types can be defined in terms of
diff --git a/pkg/front_end/lib/src/builder/type_alias_builder.dart b/pkg/front_end/lib/src/builder/type_alias_builder.dart
index b70721f..ca201dd 100644
--- a/pkg/front_end/lib/src/builder/type_alias_builder.dart
+++ b/pkg/front_end/lib/src/builder/type_alias_builder.dart
@@ -4,6 +4,7 @@
part of 'declaration_builders.dart';
+// Coverage-ignore(suite): Not run.
abstract class TypeAliasBuilder implements TypeDeclarationBuilder {
TypeBuilder get type;
@@ -227,6 +228,7 @@
if (typeVariables != null) {
if (typeArguments == null ||
typeVariables.length != typeArguments.length) {
+ // Coverage-ignore-block(suite): Not run.
typeArguments = <TypeBuilder>[
for (NominalVariableBuilder typeVariable in typeVariables)
typeVariable.defaultType!
@@ -243,6 +245,7 @@
unboundTypeVariables: unboundTypeVariables);
}
_typeAliasesUsedInUnaliasing.addAll(usedTypeAliasBuilders);
+ // Coverage-ignore(suite): Not run.
case ExtensionBuilder():
unexpected(
"type", "${rhsTypeDeclaration.runtimeType}", charOffset, fileUri);
@@ -349,6 +352,7 @@
return _cachedUnaliasedDeclaration = this;
}
if (builders.contains(current)) {
+ // Coverage-ignore-block(suite): Not run.
// Cyclic type alias.
currentAliasBuilder.libraryBuilder.addProblem(
templateCyclicTypedef.withArguments(this.name),
@@ -452,6 +456,7 @@
}
if ((currentAliasBuilder.typeVariables?.length ?? 0) !=
currentTypeArguments.length) {
+ // Coverage-ignore-block(suite): Not run.
if (previousAliasBuilder != null) {
previousAliasBuilder.libraryBuilder.addProblem(
templateTypeArgumentMismatch.withArguments(
@@ -492,6 +497,7 @@
}
return declarationBuilder;
}
+ // Coverage-ignore(suite): Not run.
// This can be null, e.g, `substitutedBuilder is FunctionTypeBuilder`
return substitutedBuilder.declaration;
}
@@ -532,7 +538,9 @@
while (currentDeclarationBuilder is TypeAliasBuilder) {
TypeAliasBuilder currentAliasBuilder = currentDeclarationBuilder;
TypeBuilder nextTypeBuilder = currentAliasBuilder.type;
- assert(nextTypeBuilder is NamedTypeBuilder,
+ assert(
+ nextTypeBuilder is NamedTypeBuilder,
+ // Coverage-ignore(suite): Not run.
"Expected NamedTypeBuilder, got '${nextTypeBuilder.runtimeType}'.");
NamedTypeBuilder namedNextTypeBuilder =
nextTypeBuilder as NamedTypeBuilder;
@@ -540,6 +548,7 @@
int index = 0;
if (currentTypeArguments == null || currentTypeArguments.isEmpty) {
if (currentAliasBuilder.typeVariables != null) {
+ // Coverage-ignore-block(suite): Not run.
List<TypeBuilder> defaultTypeArguments =
new List<TypeBuilder>.generate(
currentAliasBuilder.typeVariables!.length, (int i) {
@@ -561,6 +570,7 @@
namedNextTypeBuilder.declaration;
TypeBuilder substitutedBuilder = nextTypeBuilder.subst(substitution);
if (nextDeclarationBuilder is NominalVariableBuilder) {
+ // Coverage-ignore-block(suite): Not run.
// We have reached the end of the type alias chain which yields a
// type argument, which may become a type alias, possibly with its
// own similar chain.
diff --git a/pkg/front_end/lib/src/builder/type_builder.dart b/pkg/front_end/lib/src/builder/type_builder.dart
index 6f83aa4..6929f32 100644
--- a/pkg/front_end/lib/src/builder/type_builder.dart
+++ b/pkg/front_end/lib/src/builder/type_builder.dart
@@ -360,9 +360,13 @@
TypeBuilder result = substitute(this, substitution,
unboundTypes: unboundTypesInternal,
unboundTypeVariables: unboundTypeVariablesInternal);
- assert(unboundTypes != null || unboundTypesInternal.isEmpty,
+ assert(
+ unboundTypes != null || unboundTypesInternal.isEmpty,
+ // Coverage-ignore(suite): Not run.
"Non-empty unbound types: $unboundTypesInternal.");
- assert(unboundTypeVariables != null || unboundTypeVariablesInternal.isEmpty,
+ assert(
+ unboundTypeVariables != null || unboundTypeVariablesInternal.isEmpty,
+ // Coverage-ignore(suite): Not run.
"Non-empty unbound type variables: $unboundTypeVariables.");
return result;
}
@@ -557,15 +561,19 @@
int get nameOffset => TreeNode.noOffset;
@override
+ // Coverage-ignore(suite): Not run.
int get nameLength => noLength;
@override
+ // Coverage-ignore(suite): Not run.
String get fullName => name;
@override
+ // Coverage-ignore(suite): Not run.
int get fullNameOffset => nameOffset;
@override
+ // Coverage-ignore(suite): Not run.
int get fullNameLength => noLength;
}
@@ -584,6 +592,7 @@
SyntheticTypeName(this.name, this.nameOffset);
@override
+ // Coverage-ignore(suite): Not run.
int get nameLength => noLength;
@override
@@ -593,9 +602,11 @@
String get fullName => name;
@override
+ // Coverage-ignore(suite): Not run.
int get fullNameOffset => nameOffset;
@override
+ // Coverage-ignore(suite): Not run.
int get fullNameLength => noLength;
}
diff --git a/pkg/front_end/lib/src/builder/type_declaration_builder.dart b/pkg/front_end/lib/src/builder/type_declaration_builder.dart
index 3b2f3b0..ea9f0e7 100644
--- a/pkg/front_end/lib/src/builder/type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/type_declaration_builder.dart
@@ -4,6 +4,7 @@
part of 'declaration_builders.dart';
+// Coverage-ignore(suite): Not run.
abstract class ITypeDeclarationBuilder implements Builder {
String get name;
diff --git a/pkg/front_end/lib/src/builder/type_variable_builder.dart b/pkg/front_end/lib/src/builder/type_variable_builder.dart
index 67d9204..9694a88 100644
--- a/pkg/front_end/lib/src/builder/type_variable_builder.dart
+++ b/pkg/front_end/lib/src/builder/type_variable_builder.dart
@@ -51,6 +51,7 @@
String get debugName => "TypeVariableBuilderBase";
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
buffer.write(name);
if (bound != null) {
@@ -64,6 +65,7 @@
String toString() => "${printOn(new StringBuffer())}";
@override
+ // Coverage-ignore(suite): Not run.
TypeVariableBuilderBase get origin => actualOrigin ?? this;
Variance get variance;
@@ -129,6 +131,7 @@
{Map<TypeVariableBuilderBase, TypeVariableTraversalState>?
typeVariablesTraversalState,
Map<TypeVariableBuilderBase, TypeVariableBuilderBase>? cycleElements}) {
+ // Coverage-ignore(suite): Not run.
typeVariablesTraversalState ??= {};
cycleElements ??= {};
@@ -321,6 +324,7 @@
int charOffset,
{required bool hasExplicitTypeArguments}) {
if (arguments != null) {
+ // Coverage-ignore-block(suite): Not run.
int charOffset = -1; // TODO(ahe): Provide these.
Uri? fileUri = null; // TODO(ahe): Provide these.
library.addProblem(
@@ -343,6 +347,7 @@
ClassHierarchyBase? hierarchy,
{required bool hasExplicitTypeArguments}) {
if (arguments != null) {
+ // Coverage-ignore-block(suite): Not run.
library.addProblem(
templateTypeArgumentsOnTypeVariable.withArguments(name),
charOffset,
@@ -379,6 +384,7 @@
library.registerPendingNullability(
this.fileUri!, this.charOffset, type);
} else {
+ // Coverage-ignore-block(suite): Not run.
library.addProblem(
templateInternalProblemUnfinishedTypeVariable.withArguments(
name, library.importUri),
@@ -409,7 +415,8 @@
const NullabilityBuilder.nullable(),
/* arguments = */ null,
TypeUse.typeParameterBound,
- fileUri ?? missingUri,
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ missingUri,
charOffset,
/* hierarchy = */ null,
hasExplicitTypeArguments: false);
@@ -503,6 +510,7 @@
case ExtensionBuilder():
case BuiltinTypeDeclarationBuilder():
case InvalidTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -538,6 +546,7 @@
internalDependents.add(field.type);
}
}
+ // Coverage-ignore(suite): Not run.
case OmittedTypeBuilder():
case FixedTypeBuilder():
case InvalidTypeBuilder():
@@ -617,31 +626,38 @@
Variance get variance => parameter.variance;
@override
+ // Coverage-ignore(suite): Not run.
void set variance(Variance value) {
parameter.variance = value;
}
@override
+ // Coverage-ignore(suite): Not run.
bool get hasUnsetParameterBound =>
identical(parameter.bound, StructuralParameter.unsetBoundSentinel);
@override
+ // Coverage-ignore(suite): Not run.
DartType get parameterBound => parameter.bound;
@override
+ // Coverage-ignore(suite): Not run.
void set parameterBound(DartType bound) {
parameter.bound = bound;
}
@override
+ // Coverage-ignore(suite): Not run.
Nullability get nullabilityFromParameterBound =>
StructuralParameterType.computeNullabilityFromBound(parameter);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasUnsetParameterDefaultType => identical(
parameter.defaultType, StructuralParameter.unsetDefaultTypeSentinel);
@override
+ // Coverage-ignore(suite): Not run.
void set parameterDefaultType(DartType defaultType) {
parameter.defaultType = defaultType;
}
@@ -655,6 +671,7 @@
int get hashCode => parameter.hashCode;
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
buffer.write(name);
if (bound != null) {
@@ -684,6 +701,7 @@
ClassHierarchyBase? hierarchy,
{required bool hasExplicitTypeArguments}) {
if (arguments != null) {
+ // Coverage-ignore-block(suite): Not run.
library.addProblem(
templateTypeArgumentsOnTypeVariable.withArguments(name),
charOffset,
@@ -712,6 +730,7 @@
StructuralParameterType.computeNullabilityFromBound(parameter);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
nullability = nullabilityBuilder.build();
}
StructuralParameterType type = buildAliasedTypeWithBuiltArguments(
@@ -722,6 +741,7 @@
library.registerPendingFunctionTypeNullability(
this.fileUri!, this.charOffset, type);
} else {
+ // Coverage-ignore-block(suite): Not run.
library.addProblem(
templateInternalProblemUnfinishedTypeVariable.withArguments(
name, library.importUri),
@@ -743,6 +763,7 @@
int charOffset,
{required bool hasExplicitTypeArguments}) {
if (arguments != null) {
+ // Coverage-ignore-block(suite): Not run.
int charOffset = -1; // TODO(ahe): Provide these.
Uri? fileUri = null; // TODO(ahe): Provide these.
library.addProblem(
@@ -763,7 +784,8 @@
const NullabilityBuilder.nullable(),
/* arguments = */ null,
TypeUse.typeParameterBound,
- fileUri ?? missingUri,
+ fileUri ?? // Coverage-ignore(suite): Not run.
+ missingUri,
charOffset,
/* hierarchy = */ null,
hasExplicitTypeArguments: false);
@@ -786,6 +808,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void applyAugmentation(covariant StructuralVariableBuilder augmentation) {
augmentation.actualOrigin = this;
}
diff --git a/pkg/front_end/lib/src/codes/type_labeler.dart b/pkg/front_end/lib/src/codes/type_labeler.dart
index 7341b23..f0204cb 100644
--- a/pkg/front_end/lib/src/codes/type_labeler.dart
+++ b/pkg/front_end/lib/src/codes/type_labeler.dart
@@ -159,7 +159,8 @@
@override
void visitStructuralParameterType(StructuralParameterType node) {
- result.add(node.parameter.name ?? "T#${identityHashCode(node.parameter)}");
+ result.add(node.parameter.name ?? // Coverage-ignore(suite): Not run.
+ "T#${identityHashCode(node.parameter)}");
addNullability(node.declaredNullability);
}
@@ -203,6 +204,7 @@
i < node.positionalParameters.length;
i++) {
if (!first) {
+ // Coverage-ignore-block(suite): Not run.
result.add(", ");
}
node.positionalParameters[i].accept(this);
@@ -216,6 +218,7 @@
first = true;
for (int i = 0; i < node.namedParameters.length; i++) {
if (!first) {
+ // Coverage-ignore-block(suite): Not run.
result.add(", ");
}
node.namedParameters[i].type.accept(this);
@@ -330,6 +333,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitSymbolConstant(SymbolConstant node) {
String text = node.libraryReference != null
? '#${node.libraryReference!.asLibrary.importUri}::${node.name}'
@@ -374,6 +378,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitSetConstant(SetConstant node) {
result.add("<");
node.typeArgument.accept(this);
@@ -397,6 +402,7 @@
bool first = true;
for (ConstantMapEntry entry in node.entries) {
if (!first) {
+ // Coverage-ignore-block(suite): Not run.
result.add(", ");
}
entry.key.accept(this);
@@ -460,6 +466,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitRedirectingFactoryTearOffConstant(
RedirectingFactoryTearOffConstant node) {
Member constructor = node.target;
@@ -489,6 +496,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitTypedefTearOffConstant(TypedefTearOffConstant node) {
node.tearOffConstant.accept(this);
if (node.parameters.isNotEmpty) {
@@ -583,7 +591,9 @@
}
Message message = (importUri == fileUri || importUri.isScheme('dart'))
? templateTypeOrigin.withArguments(toString(), importUri)
- : templateTypeOriginWithFileUri.withArguments(
+ :
+ // Coverage-ignore(suite): Not run.
+ templateTypeOriginWithFileUri.withArguments(
toString(), importUri, fileUri);
return "\n - " + message.problemMessage;
}
diff --git a/pkg/front_end/lib/src/compute_platform_binaries_location.dart b/pkg/front_end/lib/src/compute_platform_binaries_location.dart
index aedad6e..54cb712 100644
--- a/pkg/front_end/lib/src/compute_platform_binaries_location.dart
+++ b/pkg/front_end/lib/src/compute_platform_binaries_location.dart
@@ -25,6 +25,7 @@
// DDC is always compiled against the outline so we use it here by
// default.
return 'ddc_outline.dill';
+ // Coverage-ignore(suite): Not run.
//TODO(johnniwinther): Support using the full dill.
//return 'ddc_platform.dill';
case NnbdMode.Weak:
@@ -38,13 +39,16 @@
switch (nnbdMode) {
case NnbdMode.Strong:
return 'dart2js_platform.dill';
+ // Coverage-ignore(suite): Not run.
case NnbdMode.Weak:
return 'dart2js_platform_unsound.dill';
}
case 'dart2js_server':
switch (nnbdMode) {
+ // Coverage-ignore(suite): Not run.
case NnbdMode.Strong:
return 'dart2js_server_platform.dill';
+ // Coverage-ignore(suite): Not run.
case NnbdMode.Weak:
return 'dart2js_server_platform_unsound.dill';
}
@@ -58,12 +62,14 @@
switch (nnbdMode) {
case NnbdMode.Strong:
return 'dart2wasm_outline.dill';
+ // Coverage-ignore(suite): Not run.
//TODO(johnniwinther): Support using the full dill.
//return 'dart2wasm_platform.dill';
case NnbdMode.Weak:
break;
}
break;
+ // Coverage-ignore(suite): Not run.
case 'wasm_js_compatibility':
switch (nnbdMode) {
case NnbdMode.Strong:
@@ -77,6 +83,7 @@
default:
break;
}
+ // Coverage-ignore-block(suite): Not run.
onError();
return null;
}
@@ -114,15 +121,19 @@
ProcessedOptions options = context.options;
sdkRoot = options.sdkRoot;
if (sdkRoot == null) {
- sdkRoot = options.librariesSpecificationUri?.resolve("../");
+ sdkRoot = options.librariesSpecificationUri
+ // Coverage-ignore(suite): Not run.
+ ?.resolve("../");
if (sdkRoot != null) {
+ // Coverage-ignore-block(suite): Not run.
if (!isExistingFile(sdkRoot.resolve("lib/libraries.json"))) {
sdkRoot = null;
}
}
}
if (sdkRoot == null) {
- sdkRoot = (options.sdkSummary ?? computePlatformBinariesLocation())
+ sdkRoot = (options.sdkSummary ?? // Coverage-ignore(suite): Not run.
+ computePlatformBinariesLocation())
.resolve("../../");
if (!isExistingFile(sdkRoot.resolve("lib/libraries.json"))) {
if (isExistingFile(sdkRoot.resolve("sdk/lib/libraries.json"))) {
@@ -132,6 +143,7 @@
}
}
}
+ // Coverage-ignore(suite): Not run.
sdkRoot ??= Uri.parse("org-dartlang-sdk:///sdk/");
context.cachedSdkRoot = sdkRoot;
}
@@ -140,6 +152,7 @@
Map<Uri, Source> uriToSource = CompilerContext.current.uriToSource;
Source source = uriToSource[uri]!;
if (source.source.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
uriToSource[uri] = new Source(
source.lineStarts,
new File.fromUri(candidate).readAsBytesSync(),
diff --git a/pkg/front_end/lib/src/dill/dill_class_builder.dart b/pkg/front_end/lib/src/dill/dill_class_builder.dart
index 428e9fef..c5483b0 100644
--- a/pkg/front_end/lib/src/dill/dill_class_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_class_builder.dart
@@ -25,6 +25,7 @@
ConstructorScope get constructorScope;
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> fullConstructorIterator<T extends MemberBuilder>() =>
constructorScope.filteredIterator<T>(
includeAugmentations: true, includeDuplicates: false);
@@ -40,6 +41,7 @@
includeAugmentations: true, includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
NameIterator<T> fullMemberNameIterator<T extends Builder>() =>
scope.filteredNameIterator<T>(
includeAugmentations: true, includeDuplicates: false);
@@ -129,6 +131,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
List<TypeBuilder>? get onTypes => null;
void addField(Field field) {
@@ -154,6 +157,7 @@
String name = procedure.name.text;
switch (procedure.kind) {
case ProcedureKind.Factory:
+ // Coverage-ignore(suite): Not run.
throw new UnsupportedError("Use addFactory for adding factories");
case ProcedureKind.Setter:
scope.addLocalMember(name, new DillSetterBuilder(procedure, this),
@@ -204,6 +208,7 @@
bool get isMixinApplication => cls.isMixinApplication;
@override
+ // Coverage-ignore(suite): Not run.
bool get declaresConstConstructor => cls.hasConstConstructor;
@override
@@ -212,6 +217,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void set mixedInTypeBuilder(TypeBuilder? mixin) {
unimplemented("mixedInType=", -1, null);
}
diff --git a/pkg/front_end/lib/src/dill/dill_extension_builder.dart b/pkg/front_end/lib/src/dill/dill_extension_builder.dart
index 9a867ba..6e7a056 100644
--- a/pkg/front_end/lib/src/dill/dill_extension_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_extension_builder.dart
@@ -48,7 +48,9 @@
} else {
Procedure procedure = descriptor.memberReference.asProcedure;
Procedure? tearOff = descriptor.tearOffReference?.asProcedure;
- assert(tearOff != null, "No tear found for ${descriptor}");
+ assert(
+ tearOff != null, // Coverage-ignore(suite): Not run.
+ "No tear found for ${descriptor}");
scope.addLocalMember(
name.text,
new DillExtensionInstanceMethodBuilder(
@@ -94,11 +96,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder get onType {
return _onType ??=
libraryBuilder.loader.computeTypeBuilder(extension.onType);
}
@override
+ // Coverage-ignore(suite): Not run.
List<TypeParameter> get typeParameterNodes => extension.typeParameters;
}
diff --git a/pkg/front_end/lib/src/dill/dill_extension_member_builder.dart b/pkg/front_end/lib/src/dill/dill_extension_member_builder.dart
index 8a09dc2..c96598b 100644
--- a/pkg/front_end/lib/src/dill/dill_extension_member_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_extension_member_builder.dart
@@ -17,9 +17,11 @@
bool get isStatic => _descriptor.isStatic;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExternal => member.isExternal;
@override
+ // Coverage-ignore(suite): Not run.
String get name => _descriptor.name.text;
@override
@@ -47,6 +49,7 @@
: super(field, descriptor, parent);
@override
+ // Coverage-ignore(suite): Not run.
Member get member => field;
@override
@@ -56,6 +59,7 @@
Member? get writeTarget => isAssignable ? field : null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => field;
@override
@@ -74,6 +78,7 @@
super(procedure, descriptor, parent);
@override
+ // Coverage-ignore(suite): Not run.
Member get member => procedure;
@override
@@ -83,6 +88,7 @@
Member get writeTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get invokeTarget => null;
}
@@ -95,12 +101,14 @@
super(procedure, descriptor, parent);
@override
+ // Coverage-ignore(suite): Not run.
Member get member => procedure;
@override
Member get readTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -122,6 +130,7 @@
Member? get readTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -138,15 +147,18 @@
super(procedure, descriptor, parent);
@override
+ // Coverage-ignore(suite): Not run.
Member get member => procedure;
@override
Member get readTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => procedure;
}
@@ -165,15 +177,18 @@
super(procedure, descriptor, parent);
@override
+ // Coverage-ignore(suite): Not run.
Member get member => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => [procedure, _extensionTearOff];
@override
Member get readTarget => _extensionTearOff;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
diff --git a/pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart b/pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart
index 8645393..684a37a 100644
--- a/pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_extension_type_declaration_builder.dart
@@ -48,10 +48,12 @@
String name = procedure.name.text;
switch (procedure.kind) {
case ProcedureKind.Factory:
+ // Coverage-ignore(suite): Not run.
throw new UnsupportedError(
"Unexpected procedure kind in extension type declaration: "
"$procedure (${procedure.kind}).");
case ProcedureKind.Setter:
+ // Coverage-ignore(suite): Not run.
scope.addLocalMember(name, new DillSetterBuilder(procedure, this),
setter: true);
break;
@@ -84,7 +86,9 @@
} else {
Procedure procedure = descriptor.memberReference.asProcedure;
Procedure? tearOff = descriptor.tearOffReference?.asProcedure;
- assert(tearOff != null, "No tear found for ${descriptor}");
+ assert(
+ tearOff != null, // Coverage-ignore(suite): Not run.
+ "No tear found for ${descriptor}");
scope.addLocalMember(
name.text,
new DillExtensionTypeInstanceMethodBuilder(
diff --git a/pkg/front_end/lib/src/dill/dill_extension_type_member_builder.dart b/pkg/front_end/lib/src/dill/dill_extension_type_member_builder.dart
index 3d87c66..1289c88 100644
--- a/pkg/front_end/lib/src/dill/dill_extension_type_member_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_extension_type_member_builder.dart
@@ -19,6 +19,7 @@
bool get isStatic => _descriptor.isStatic;
@override
+ // Coverage-ignore(suite): Not run.
bool get isExternal => member.isExternal;
@override
@@ -36,8 +37,11 @@
case ExtensionTypeMemberKind.Setter:
return ProcedureKind.Setter;
case ExtensionTypeMemberKind.Field:
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeMemberKind.Constructor:
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeMemberKind.Factory:
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeMemberKind.RedirectingFactory:
}
return null;
@@ -67,8 +71,10 @@
case ExtensionTypeMemberKind.Operator:
case ExtensionTypeMemberKind.Setter:
case ExtensionTypeMemberKind.Field:
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeMemberKind.Constructor:
return false;
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeMemberKind.Factory:
case ExtensionTypeMemberKind.RedirectingFactory:
return true;
@@ -96,6 +102,7 @@
Member? get writeTarget => isAssignable ? field : null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => field;
@override
@@ -141,6 +148,7 @@
Member get readTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -162,6 +170,7 @@
Member? get readTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -185,9 +194,11 @@
Member get readTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => procedure;
}
@@ -210,12 +221,14 @@
Member get member => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => [procedure, _extensionTearOff];
@override
Member get readTarget => _extensionTearOff;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -241,9 +254,12 @@
Procedure get member => constructor;
@override
- Member get readTarget => _constructorTearOff ?? constructor;
+ Member get readTarget =>
+ _constructorTearOff ?? // Coverage-ignore(suite): Not run.
+ constructor;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -262,9 +278,12 @@
Member get member => _procedure;
@override
- Member? get readTarget => _factoryTearOff ?? _procedure;
+ Member? get readTarget =>
+ _factoryTearOff ?? // Coverage-ignore(suite): Not run.
+ _procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
diff --git a/pkg/front_end/lib/src/dill/dill_library_builder.dart b/pkg/front_end/lib/src/dill/dill_library_builder.dart
index 436a3b3..25bde44 100644
--- a/pkg/front_end/lib/src/dill/dill_library_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_library_builder.dart
@@ -67,6 +67,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void addProblem(Message message, int charOffset, int length, Uri? fileUri,
{bool wasHandled = false,
List<LocatedMessage>? context,
@@ -174,6 +175,7 @@
throw new StateError("Not ready to build.");
}
if (isBuilt && !isBuiltAndMarked) {
+ // Coverage-ignore-block(suite): Not run.
isBuiltAndMarked = true;
finalizeExports();
return;
@@ -223,6 +225,7 @@
Uri get fileUri => library.fileUri;
@override
+ // Coverage-ignore(suite): Not run.
String? get name => library.name;
@override
@@ -299,6 +302,7 @@
StringConstant string = constantExpression.constant as StringConstant;
stringValue = string.value;
} else {
+ // Coverage-ignore-block(suite): Not run.
StringLiteral string = field.initializer as StringLiteral;
stringValue = string.value;
}
@@ -317,11 +321,13 @@
_addBuilder(name, new DillGetterBuilder(member, this));
break;
case ProcedureKind.Operator:
+ // Coverage-ignore(suite): Not run.
_addBuilder(name, new DillOperatorBuilder(member, this));
break;
case ProcedureKind.Method:
_addBuilder(name, new DillMethodBuilder(member, this));
break;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
throw new UnsupportedError(
"Unexpected library procedure ${member.kind} for ${member}");
@@ -362,6 +368,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Builder computeAmbiguousDeclaration(
String name, Builder builder, Builder other, int charOffset,
{bool isExport = false, bool isImport = false}) {
@@ -379,6 +386,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors {
return library.name ?? "<library '${library.fileUri}'>";
}
@@ -397,11 +405,14 @@
Builder declaration;
if (messageText == exportDynamicSentinel) {
assert(
- name == 'dynamic', "Unexpected export name for 'dynamic': '$name'");
+ name == 'dynamic', // Coverage-ignore(suite): Not run.
+ "Unexpected export name for 'dynamic': '$name'");
declaration = loader.coreLibrary.exportScope
.lookupLocalMember(name, setter: false)!;
} else if (messageText == exportNeverSentinel) {
- assert(name == 'Never', "Unexpected export name for 'Never': '$name'");
+ assert(
+ name == 'Never', // Coverage-ignore(suite): Not run.
+ "Unexpected export name for 'Never': '$name'");
declaration = loader.coreLibrary.exportScope
.lookupLocalMember(name, setter: false)!;
} else {
@@ -422,6 +433,7 @@
Builder declaration;
String name;
if (sourceBuildersMap?.containsKey(reference) == true) {
+ // Coverage-ignore-block(suite): Not run.
declaration = sourceBuildersMap![reference]!;
if (declaration is TypeDeclarationBuilder) {
name = declaration.name;
@@ -492,18 +504,21 @@
node == declaration.extension) ||
(declaration is ExtensionTypeDeclarationBuilder &&
node == declaration.extensionTypeDeclaration),
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration ${declaration} (${declaration.runtimeType}) "
"for node ${node} (${node.runtimeType}).");
}
}
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> fullMemberIterator<T extends Builder>() {
return scope.filteredIterator<T>(
includeDuplicates: false, includeAugmentations: false);
}
@override
+ // Coverage-ignore(suite): Not run.
NameIterator<T> fullMemberNameIterator<T extends Builder>() {
return scope.filteredNameIterator(
includeDuplicates: false, includeAugmentations: false);
diff --git a/pkg/front_end/lib/src/dill/dill_loader.dart b/pkg/front_end/lib/src/dill/dill_loader.dart
index 83d5319..7e27bbe 100644
--- a/pkg/front_end/lib/src/dill/dill_loader.dart
+++ b/pkg/front_end/lib/src/dill/dill_loader.dart
@@ -106,7 +106,9 @@
DillLibraryBuilder? libraryBuilder = _builders[uri];
if (libraryBuilder == null) {
libraryBuilder = _knownLibraryBuilders.remove(uri);
- assert(libraryBuilder != null, "No library found for $uri.");
+ assert(
+ libraryBuilder != null, // Coverage-ignore(suite): Not run.
+ "No library found for $uri.");
_builders[uri] = libraryBuilder!;
assert(libraryBuilder.loader == this);
if (uri.isScheme("dart")) {
@@ -136,6 +138,7 @@
!accessor.isPart &&
!target.backendTarget
.allowPlatformPrivateLibraryAccess(accessor.importUri, uri)) {
+ // Coverage-ignore-block(suite): Not run.
accessor.addProblem(messagePlatformPrivateLibraryAccess, charOffset,
noLength, accessor.fileUri);
}
@@ -145,6 +148,7 @@
void _ensureCoreLibrary() {
if (_coreLibrary == null) {
+ // Coverage-ignore-block(suite): Not run.
read(Uri.parse("dart:core"), 0, accessor: first);
// TODO(askesc): When all backends support set literals, we no longer
// need to index dart:collection, as it is only needed for desugaring of
@@ -164,7 +168,9 @@
}
void _logSummary(Template<SummaryTemplate> template) {
- ticker.log((Duration elapsed, Duration sinceStart) {
+ ticker.log(
+ // Coverage-ignore(suite): Not run.
+ (Duration elapsed, Duration sinceStart) {
int libraryCount = 0;
for (DillLibraryBuilder library in libraryBuilders) {
assert(library.loader == this);
@@ -237,14 +243,23 @@
target.context.report(
fileUri != null
? message.withLocation(fileUri, charOffset, length)
- : message.withoutLocation(),
+ :
+ // Coverage-ignore(suite): Not run.
+ message.withoutLocation(),
severity,
context: context,
involvedFiles: involvedFiles);
if (severity == Severity.error) {
- (wasHandled ? handledErrors : unhandledErrors).add(fileUri != null
- ? message.withLocation(fileUri, charOffset, length)
- : message.withoutLocation());
+ (wasHandled
+ ?
+ // Coverage-ignore(suite): Not run.
+ handledErrors
+ : unhandledErrors)
+ .add(fileUri != null
+ ? message.withLocation(fileUri, charOffset, length)
+ :
+ // Coverage-ignore(suite): Not run.
+ message.withoutLocation());
}
FormattedMessage formattedMessage = target.createFormattedMessage(
message, charOffset, length, fileUri, context, severity,
@@ -264,7 +279,9 @@
for (int i = 0; i < componentLibraries.length; i++) {
Library library = componentLibraries[i];
Uri uri = library.importUri;
- if (filter == null || filter(library.importUri)) {
+ if (filter == null ||
+ // Coverage-ignore(suite): Not run.
+ filter(library.importUri)) {
libraries.add(library);
registerKnownLibrary(library);
requestedLibraries.add(uri);
@@ -340,6 +357,7 @@
return _typeBuilderComputer.visit(type);
}
+ // Coverage-ignore(suite): Not run.
bool containsLibraryBuilder(Uri importUri) =>
_builders.containsKey(importUri);
@@ -348,8 +366,10 @@
Iterable<DillLibraryBuilder> get libraryBuilders => _builders.values;
+ // Coverage-ignore(suite): Not run.
Iterable<Uri> get libraryImportUris => _builders.keys;
+ // Coverage-ignore(suite): Not run.
void registerLibraryBuilder(DillLibraryBuilder libraryBuilder) {
Uri importUri = libraryBuilder.importUri;
libraryBuilder.loader = this;
diff --git a/pkg/front_end/lib/src/dill/dill_member_builder.dart b/pkg/front_end/lib/src/dill/dill_member_builder.dart
index 7fff872..9ce1782 100644
--- a/pkg/front_end/lib/src/dill/dill_member_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_member_builder.dart
@@ -57,7 +57,11 @@
@override
ProcedureKind? get kind {
final Member member = this.member;
- return member is Procedure ? member.kind : null;
+ return member is Procedure
+ ?
+ // Coverage-ignore(suite): Not run.
+ member.kind
+ : null;
}
@override
@@ -82,6 +86,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool get isAssignable => false;
List<ClassMember>? _localMembers;
@@ -105,6 +110,7 @@
: const <ClassMember>[];
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Annotatable> get annotatables => [member];
}
@@ -124,6 +130,7 @@
Member? get writeTarget => isAssignable ? field : null;
@override
+ // Coverage-ignore(suite): Not run.
Member? get invokeTarget => field;
@override
@@ -160,9 +167,11 @@
Member get readTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => procedure;
}
@@ -175,12 +184,14 @@
Member get member => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get readTarget => null;
@override
Member get writeTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get invokeTarget => null;
}
@@ -196,9 +207,11 @@
Member get readTarget => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => procedure;
}
@@ -211,12 +224,15 @@
Member get member => procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get readTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Member get invokeTarget => procedure;
}
@@ -233,6 +249,7 @@
Member? get readTarget => _factoryTearOff ?? procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -258,6 +275,7 @@
Member get readTarget => _constructorTearOff ?? constructor;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -319,11 +337,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void inferType(ClassMembersBuilder hierarchy) {
// Do nothing; this is only for source members.
}
@override
+ // Coverage-ignore(suite): Not run.
void registerOverrideDependency(Set<ClassMember> overriddenMembers) {
// Do nothing; this is only for source members.
}
@@ -363,6 +383,7 @@
} else if (member is Constructor) {
modifier |= member.isConst ? constMask : 0;
} else {
+ // Coverage-ignore-block(suite): Not run.
dynamic parent = member.parent;
unhandled("${member.runtimeType}", "computeModifiers", member.fileOffset,
Uri.base.resolve(parent.fileUri));
diff --git a/pkg/front_end/lib/src/dill/dill_target.dart b/pkg/front_end/lib/src/dill/dill_target.dart
index c1c14b3..527430a 100644
--- a/pkg/front_end/lib/src/dill/dill_target.dart
+++ b/pkg/front_end/lib/src/dill/dill_target.dart
@@ -43,6 +43,7 @@
accessor: loader.coreLibraryCompilationUnit);
}
if (context.compilingPlatform) {
+ // Coverage-ignore-block(suite): Not run.
for (String uri in backendTarget.extraRequiredLibrariesPlatform) {
loader.read(Uri.parse(uri), 0,
accessor: loader.coreLibraryCompilationUnit);
@@ -62,7 +63,9 @@
return processedOptions.format(
fileUri != null
? message.withLocation(fileUri, charOffset, length)
- : message.withoutLocation(),
+ :
+ // Coverage-ignore(suite): Not run.
+ message.withoutLocation(),
severity,
messageContext,
involvedFiles: involvedFiles);
@@ -70,12 +73,18 @@
void buildOutlines({bool suppressFinalizationErrors = false}) {
if (loader.libraries.isNotEmpty) {
- benchmarker?.enterPhase(BenchmarkPhases.dill_buildOutlines);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.dill_buildOutlines);
loader.buildOutlines();
- benchmarker?.enterPhase(BenchmarkPhases.dill_finalizeExports);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.dill_finalizeExports);
loader.finalizeExports(
suppressFinalizationErrors: suppressFinalizationErrors);
- benchmarker?.enterPhase(BenchmarkPhases.unknownDillTarget);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.unknownDillTarget);
}
isLoaded = true;
}
diff --git a/pkg/front_end/lib/src/dill/dill_type_alias_builder.dart b/pkg/front_end/lib/src/dill/dill_type_alias_builder.dart
index 5cacfc0..eef68e4 100644
--- a/pkg/front_end/lib/src/dill/dill_type_alias_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_type_alias_builder.dart
@@ -32,6 +32,7 @@
: super(null, typedef.name, parent, typedef.fileOffset);
@override
+ // Coverage-ignore(suite): Not run.
List<MetadataBuilder> get metadata {
return unimplemented("metadata", -1, null);
}
@@ -46,6 +47,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool get fromDill => true;
@override
diff --git a/pkg/front_end/lib/src/kernel/benchmarker.dart b/pkg/front_end/lib/src/kernel/benchmarker.dart
index 4352c4f..9af9d91 100644
--- a/pkg/front_end/lib/src/kernel/benchmarker.dart
+++ b/pkg/front_end/lib/src/kernel/benchmarker.dart
@@ -1,3 +1,4 @@
+// Coverage-ignore(suite): Not run.
// Copyright (c) 2022, 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.
@@ -91,6 +92,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class PhaseTiming {
final BenchmarkPhases phase;
int _runtime = 0;
@@ -125,6 +127,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class SubdivideTiming {
final BenchmarkSubdivides phase;
int _runtime = 0;
diff --git a/pkg/front_end/lib/src/kernel/body_builder.dart b/pkg/front_end/lib/src/kernel/body_builder.dart
index 3399d8e..050609d 100644
--- a/pkg/front_end/lib/src/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/kernel/body_builder.dart
@@ -495,6 +495,7 @@
LibraryFeatures get libraryFeatures => libraryBuilder.libraryFeatures;
@override
+ // Coverage-ignore(suite): Not run.
bool get isDartLibrary =>
libraryBuilder.origin.importUri.isScheme("dart") ||
uri.isScheme("org-dartlang-sdk");
@@ -547,6 +548,7 @@
]));
assert(
expectedScopeKinds == null || expectedScopeKinds.contains(scope.kind),
+ // Coverage-ignore(suite): Not run.
"Expected the current scope to be one of the kinds "
"${expectedScopeKinds.map((k) => "'${k}'").join(", ")}, "
"but got '${scope.kind}'.");
@@ -772,7 +774,9 @@
return forest.createConstantPattern(node.buildSimpleRead());
} else if (node is Expression) {
return forest.createConstantPattern(node);
- } else if (node is ProblemBuilder) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (node is ProblemBuilder) {
// ignore: unused_local_variable
Expression expression =
buildProblem(node.message, node.charOffset, noLength);
@@ -834,6 +838,7 @@
switchScope!.unclaimedForwardDeclarations!
.forEach((String name, JumpTarget declaration) {
if (outerSwitchScope == null) {
+ // Coverage-ignore-block(suite): Not run.
for (Statement statement in declaration.users) {
statement.parent!.replaceChild(
statement,
@@ -860,6 +865,7 @@
buildProblem(message, offset, name.length, context: context)
..parent = variable;
} else {
+ // Coverage-ignore-block(suite): Not run.
variable.initializer = wrapInLocatedProblem(
variable.initializer!, message.withLocation(uri, offset, name.length),
context: context)
@@ -965,6 +971,7 @@
pop(); // Type arguments (ignored, already reported by parser).
Object? expression = pop();
if (expression is Identifier) {
+ // Coverage-ignore-block(suite): Not run.
Identifier identifier = expression;
expression = new UnresolvedNameGenerator(this, identifier.token,
new Name(identifier.name, libraryBuilder.nameOrigin),
@@ -987,7 +994,9 @@
// TODO(johnniwinther): Stop using the type of the generator here.
// Ask a property instead.
(expression is! ReadOnlyAccessGenerator ||
+ // Coverage-ignore(suite): Not run.
expression is TypeUseGenerator ||
+ // Coverage-ignore(suite): Not run.
expression is ParenthesizedExpressionGenerator)) {
Expression value = toValue(expression);
push(wrapInProblem(value, fasta.messageExpressionNotMetadata,
@@ -1153,6 +1162,7 @@
if (hasDelayedActions) {
assert(
delayedActionPerformers != null,
+ // Coverage-ignore(suite): Not run.
"Body builder has delayed actions that cannot be performed: "
"${[
...delayedRedirectingFactoryInvocations,
@@ -1195,6 +1205,7 @@
if (formal.isInitializingFormal) {
List<Initializer> initializers;
if (_context.isExternalConstructor) {
+ // Coverage-ignore-block(suite): Not run.
initializers = <Initializer>[
buildInvalidInitializer(
buildProblem(
@@ -1280,6 +1291,7 @@
} else if (node is Generator) {
initializers = node.buildFieldInitializer(initializedFields);
} else if (node is ConstructorInvocation) {
+ // Coverage-ignore-block(suite): Not run.
initializers = <Initializer>[
// TODO(jensj): Does this offset make sense?
buildSuperInitializer(
@@ -1368,6 +1380,7 @@
}
if (inferInitializer) {
if (!parameter.initializerWasInferred) {
+ // Coverage-ignore(suite): Not run.
initializer ??= forest.createNullLiteral(
// TODO(ahe): Should store: originParameter.fileOffset
// https://github.com/dart-lang/sdk/issues/32289
@@ -1425,7 +1438,9 @@
formals!.parameters!.length != 1 ||
formals.parameters!.single.isOptionalPositional) {
int charOffset = formals?.charOffset ??
+ // Coverage-ignore(suite): Not run.
body?.fileOffset ??
+ // Coverage-ignore(suite): Not run.
_context.memberCharOffset;
if (body == null) {
body = new EmptyStatement()..fileOffset = charOffset;
@@ -1536,6 +1551,7 @@
Library ensureLibraryLoaded = member.enclosingLibrary;
LibraryBuilder? builder = libraryBuilder.loader
.lookupLoadedLibraryBuilder(ensureLibraryLoaded.importUri) ??
+ // Coverage-ignore(suite): Not run.
libraryBuilder.loader.target.dillTarget.loader
.lookupLibraryBuilder(ensureLibraryLoaded.importUri);
if (builder is DillLibraryBuilder) {
@@ -1572,6 +1588,7 @@
return sub.substituteType(nextTypeArguments[i]);
}, growable: true);
} else {
+ // Coverage-ignore-block(suite): Not run.
typeArguments = <DartType>[];
}
target = nextMember;
@@ -1680,7 +1697,9 @@
];
typeAliasedConstructorInvocations.clear();
for (TypeAliasedConstructorInvocation invocation in invocations) {
- assert(invocation.hasBeenInferred || isOrphaned(invocation),
+ assert(
+ invocation.hasBeenInferred || isOrphaned(invocation),
+ // Coverage-ignore(suite): Not run.
"Node $invocation has not been inferred.");
Expression? replacement;
@@ -1720,7 +1739,9 @@
typeAliasedFactoryInvocations.toList();
typeAliasedFactoryInvocations.clear();
for (TypeAliasedFactoryInvocation invocation in invocations) {
- assert(invocation.hasBeenInferred || isOrphaned(invocation),
+ assert(
+ invocation.hasBeenInferred || isOrphaned(invocation),
+ // Coverage-ignore(suite): Not run.
"Node $invocation has not been inferred.");
Expression? replacement;
@@ -1769,6 +1790,7 @@
_resolveRedirectingFactoryTargets(delayedRedirectingFactoryInvocations,
allowFurtherDelays: allowFurtherDelays);
if (delayedRedirectingFactoryInvocations.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
for (StaticInvocation invocation
in delayedRedirectingFactoryInvocations) {
internalProblem(
@@ -1783,6 +1805,7 @@
_unaliasTypeAliasedFactoryInvocations(
delayedTypeAliasedFactoryInvocations);
if (delayedTypeAliasedFactoryInvocations.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
for (StaticInvocation invocation
in delayedTypeAliasedFactoryInvocations) {
internalProblem(
@@ -1797,6 +1820,7 @@
_unaliasTypeAliasedConstructorInvocations(
delayedTypeAliasedConstructorInvocations);
if (delayedTypeAliasedConstructorInvocations.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
for (ConstructorInvocation invocation
in delayedTypeAliasedConstructorInvocations) {
internalProblem(
@@ -1861,12 +1885,15 @@
parent.addAnnotation(expression);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
temporaryParent = new ListLiteral(expressions);
}
performBacklogComputations(allowFurtherDelays: false);
+ // Coverage-ignore(suite): Not run.
return temporaryParent != null ? temporaryParent.expressions : expressions;
}
+ // Coverage-ignore(suite): Not run.
Expression parseSingleExpression(
Parser parser, Token token, FunctionNode parameters) {
assert(redirectingFactoryInvocations.isEmpty);
@@ -2084,6 +2111,7 @@
} else if (formals != null) {
for (FormalParameterBuilder formal in formals) {
if (formal.isSuperInitializingFormal) {
+ // Coverage-ignore-block(suite): Not run.
if (formal.isNamed) {
NamedExpression superParameterAsArgument = new NamedExpression(
formal.name,
@@ -2458,6 +2486,7 @@
debugEvent("ParenthesizedExpression");
Expression value = popForValue();
if (value is ShadowLargeIntLiteral) {
+ // Coverage-ignore-block(suite): Not run.
// We need to know that the expression was parenthesized because we will
// treat -n differently from -(n). If the expression occurs in a double
// context, -n is a double literal and -(n) is an application of unary- to
@@ -2696,6 +2725,7 @@
Scope headScope = pop() as Scope;
assert(
headScope.classNameOrDebugName == "switch block",
+ // Coverage-ignore(suite): Not run.
"Expected to have scope 'switch block', "
"but got '${headScope.classNameOrDebugName}'.");
if (value is Pattern) {
@@ -2932,6 +2962,7 @@
push(forest.createOrPattern(token.charOffset, left, right,
orPatternJointVariables: jointVariables));
break;
+ // Coverage-ignore(suite): Not run.
default:
internalProblem(
fasta.templateInternalProblemUnhandled
@@ -2980,6 +3011,7 @@
token.charOffset,
token.length));
} else {
+ // Coverage-ignore-block(suite): Not run.
push(buildProblem(fasta.templateInvalidOperator.withArguments(token),
token.charOffset, token.length));
}
@@ -3211,9 +3243,12 @@
bool reportWarning = true,
List<LocatedMessage>? context}) {
Message message = isSuper
- ? fasta.templateSuperclassHasNoMember.withArguments(name.text)
+ ?
+ // Coverage-ignore(suite): Not run.
+ fasta.templateSuperclassHasNoMember.withArguments(name.text)
: fasta.templateMemberNotFound.withArguments(name.text);
if (reportWarning) {
+ // Coverage-ignore-block(suite): Not run.
addProblemErrorIfConst(message, charOffset, name.text.length,
context: context);
}
@@ -3228,6 +3263,7 @@
? fasta.templateSuperclassHasNoGetter.withArguments(name.text)
: fasta.templateGetterNotFound.withArguments(name.text);
if (reportWarning) {
+ // Coverage-ignore-block(suite): Not run.
addProblemErrorIfConst(message, charOffset, name.text.length,
context: context);
}
@@ -3242,6 +3278,7 @@
? fasta.templateSuperclassHasNoSetter.withArguments(name.text)
: fasta.templateSetterNotFound.withArguments(name.text);
if (reportWarning) {
+ // Coverage-ignore-block(suite): Not run.
addProblemErrorIfConst(message, charOffset, name.text.length,
context: context);
}
@@ -3268,6 +3305,7 @@
? fasta.templateSuperclassHasNoMethod.withArguments(name.text)
: fasta.templateMethodNotFound.withArguments(name.text);
if (reportWarning) {
+ // Coverage-ignore-block(suite): Not run.
addProblemErrorIfConst(message, charOffset, length, context: context);
}
return message;
@@ -3275,7 +3313,9 @@
Message warnUnresolvedConstructor(Name name, {bool isSuper = false}) {
Message message = isSuper
- ? fasta.templateSuperclassHasNoConstructor.withArguments(name.text)
+ ?
+ // Coverage-ignore(suite): Not run.
+ fasta.templateSuperclassHasNoConstructor.withArguments(name.text)
: fasta.templateConstructorNotFound.withArguments(name.text);
return message;
}
@@ -3304,6 +3344,7 @@
if (!context.inDeclaration &&
constantContext != ConstantContext.none &&
!context.allowedInConstantExpression) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(fasta.messageNotAConstantExpression, token.charOffset,
token.length);
}
@@ -3585,8 +3626,10 @@
Object? node = pop();
Object? qualifier = pop();
if (qualifier is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(qualifier);
} else if (node is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(node);
} else {
Identifier identifier = node as Identifier;
@@ -3618,6 +3661,7 @@
List<Object>? parts = const FixedNullableList<Object>()
.popNonNullable(stack, count, /* dummyValue = */ 0);
if (parts == null) {
+ // Coverage-ignore-block(suite): Not run.
push(new ParserRecovery(endToken.charOffset));
return;
}
@@ -3669,6 +3713,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleScript(Token token) {
debugEvent("Script");
}
@@ -3894,6 +3939,7 @@
void pushNewLocalVariable(Expression? initializer, {Token? equalsToken}) {
Object? node = pop();
if (node is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(node);
return;
}
@@ -3951,6 +3997,7 @@
debugEvent("NoFieldInitializer");
constantContext = _context.constantContext;
if (constantContext == ConstantContext.inferred) {
+ // Coverage-ignore-block(suite): Not run.
// Creating a null value to prevent the Dart VM from crashing.
push(forest.createNullLiteral(offsetForToken(token)));
} else {
@@ -3965,6 +4012,7 @@
debugEvent("InitializedIdentifier");
Object? node = pop();
if (node is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(node);
return;
}
@@ -4012,6 +4060,7 @@
currentLocalVariableModifiers = pop() as int;
List<Expression>? annotations = pop() as List<Expression>?;
if (node is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(node);
return;
}
@@ -4032,6 +4081,7 @@
currentLocalVariableModifiers = pop() as int;
List<Expression>? annotations = pop() as List<Expression>?;
if (variables == null) {
+ // Coverage-ignore-block(suite): Not run.
push(new ParserRecovery(offsetForToken(endToken)));
return;
}
@@ -4087,6 +4137,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleInvalidTopLevelBlock(Token token) {
// TODO(danrubel): Consider improved recovery by adding this block
// as part of a synthetic top level function.
@@ -4133,6 +4184,7 @@
void exitLoopOrSwitch(Statement statement) {
if (problemInLoopOrSwitch != null) {
+ // Coverage-ignore-block(suite): Not run.
push(problemInLoopOrSwitch);
problemInLoopOrSwitch = null;
} else {
@@ -4157,6 +4209,7 @@
new VariableDeclarationImpl.forEffect(variableOrExpression);
return <VariableDeclaration>[variable];
} else if (variableOrExpression is ExpressionStatement) {
+ // Coverage-ignore-block(suite): Not run.
VariableDeclaration variable = new VariableDeclarationImpl.forEffect(
variableOrExpression.expression);
return <VariableDeclaration>[variable];
@@ -4164,14 +4217,17 @@
return forest
.variablesDeclarationExtractDeclarations(variableOrExpression);
} else if (variableOrExpression is List<Object>) {
+ // Coverage-ignore-block(suite): Not run.
List<VariableDeclaration> variables = <VariableDeclaration>[];
for (Object v in variableOrExpression) {
variables.addAll(_buildForLoopVariableDeclarations(v)!);
}
return variables;
} else if (variableOrExpression is PatternVariableDeclaration) {
+ // Coverage-ignore-block(suite): Not run.
return <VariableDeclaration>[];
} else if (variableOrExpression is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
return <VariableDeclaration>[];
} else if (variableOrExpression == null) {
return <VariableDeclaration>[];
@@ -4487,6 +4543,7 @@
<Statement>[variableOrExpression, ...intermediateVariables!, result]);
}
if (variableOrExpression is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
problemInLoopOrSwitch ??= buildProblemStatement(
fasta.messageSyntheticToken, variableOrExpression.charOffset,
suppressMessage: true);
@@ -4556,6 +4613,7 @@
DartType typeArgument;
if (typeArguments != null) {
if (typeArguments.length > 1) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(
fasta.messageListLiteralTooManyTypeArguments,
offsetForToken(leftBracket),
@@ -4761,6 +4819,7 @@
if (setOrMapEntries != null) {
for (dynamic entry in setOrMapEntries) {
if (entry is MapLiteralEntry) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(danrubel): report the error on the colon
addProblem(fasta.templateExpectedButGot.withArguments(','),
entry.fileOffset, 1);
@@ -5004,6 +5063,7 @@
push(forest.createMapEntry(offsetForToken(colon), key, value));
} else {
if (!libraryFeatures.nullAwareElements.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(
templateExperimentNotEnabledOffByDefault
.withArguments(ExperimentalFlag.nullAwareElements.name),
@@ -5036,6 +5096,7 @@
if (identifierCount == 1) {
Object? part = pop();
if (part is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(new ParserErrorGenerator(
this, hashToken, fasta.messageSyntheticToken));
} else {
@@ -5046,6 +5107,7 @@
List<Identifier>? parts = const FixedNullableList<Identifier>()
.popNonNullable(stack, identifierCount, dummyIdentifier);
if (parts == null) {
+ // Coverage-ignore-block(suite): Not run.
push(new ParserErrorGenerator(
this, hashToken, fasta.messageSyntheticToken));
return;
@@ -5173,6 +5235,7 @@
if (existing == null) {
scope.addLocalMember(name, builder, setter: false);
} else {
+ // Coverage-ignore-block(suite): Not run.
reportDuplicatedDeclaration(existing, name, builder.charOffset);
}
}
@@ -5195,6 +5258,7 @@
if (existing == null) {
scope.addLocalMember(name, builder, setter: false);
} else {
+ // Coverage-ignore-block(suite): Not run.
reportDuplicatedDeclaration(existing, name, builder.charOffset);
}
}
@@ -5263,7 +5327,9 @@
push(new RecordTypeFieldBuilder(
[],
type is ParserRecovery
- ? new InvalidTypeBuilderImpl(uri, type.charOffset)
+ ?
+ // Coverage-ignore(suite): Not run.
+ new InvalidTypeBuilderImpl(uri, type.charOffset)
: type as TypeBuilder,
fieldName,
name is Identifier ? name.nameOffset : TreeNode.noOffset,
@@ -5318,6 +5384,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleVoidKeywordWithTypeArguments(Token token) {
assert(checkState(token, <ValueKind>[
/* arguments */ ValueKinds.TypeArgumentsOrNull,
@@ -5441,6 +5508,7 @@
debugEvent("ThrowExpression");
Expression expression = popForValue();
if (constantContext != ConstantContext.none) {
+ // Coverage-ignore-block(suite): Not run.
push(buildProblem(
fasta.templateNotConstantExpression.withArguments('Throw'),
throwToken.offset,
@@ -5991,7 +6059,10 @@
suffix = suffixObject;
} else {
assert(
- suffixObject == null || suffixObject is ParserRecovery,
+ suffixObject == null ||
+ // Coverage-ignore(suite): Not run.
+ suffixObject is ParserRecovery,
+ // Coverage-ignore(suite): Not run.
"Unexpected qualified name suffix $suffixObject "
"(${suffixObject.runtimeType})");
// There was a `.` without a suffix.
@@ -6036,6 +6107,7 @@
}
String name;
if (identifier != null && suffix != null) {
+ // Coverage-ignore-block(suite): Not run.
name = "${identifier.name}.${suffix.name}";
} else if (identifier != null) {
name = identifier.name;
@@ -6125,6 +6197,7 @@
if (isConstructorInvocation) {
if (constantContext == ConstantContext.required &&
constness == Constness.implicit) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(fasta.messageMissingExplicitConst, charOffset, charLength);
}
if (isConst && !procedure.isConst) {
@@ -6408,6 +6481,7 @@
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
if (inMetadata && typeArguments != null) {
if (!libraryFeatures.genericMetadata.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
handleRecoverableError(fasta.messageMetadataTypeArguments,
nameLastToken.next!, nameLastToken.next!);
}
@@ -6426,6 +6500,7 @@
typeArguments, name, arguments, nameToken, nameLastToken, constness,
inImplicitCreationContext: inImplicitCreationContext));
} else if (type is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(new ParserErrorGenerator(
this, nameToken, fasta.messageSyntheticToken));
} else if (type is InvalidExpression) {
@@ -6523,6 +6598,7 @@
TypeDeclarationBuilder? typeAliasBuilder,
required UnresolvedKind unresolvedKind}) {
if (arguments == null) {
+ // Coverage-ignore-block(suite): Not run.
return buildProblem(fasta.messageMissingArgumentList,
nameToken.charOffset, nameToken.length);
}
@@ -6542,6 +6618,7 @@
int numberOfTypeArguments = typeArguments?.length ?? 0;
if (typeArguments != null &&
numberOfTypeParameters != numberOfTypeArguments) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(eernst): Use position of type arguments, not nameToken.
return evaluateArgumentsBefore(
arguments,
@@ -6578,6 +6655,7 @@
target = null;
} else if (constructorBuilder.isConstructor) {
if (typeDeclarationBuilder.isAbstract) {
+ // Coverage-ignore-block(suite): Not run.
return evaluateArgumentsBefore(
arguments,
buildAbstractClassInstantiationError(
@@ -6614,9 +6692,11 @@
if (constructorBuilder == null) {
// Not found. Reported below.
} else if (constructorBuilder is AmbiguousMemberBuilder) {
+ // Coverage-ignore-block(suite): Not run.
message = constructorBuilder.message
.withLocation(uri, charOffset, noLength);
} else if (constructorBuilder.isConstructor ||
+ // Coverage-ignore(suite): Not run.
constructorBuilder.isFactory) {
Member target = constructorBuilder.invokeTarget!;
return buildStaticInvocation(target, arguments,
@@ -6630,12 +6710,14 @@
arguments: arguments,
message: message,
kind: UnresolvedKind.Constructor);
+ // Coverage-ignore(suite): Not run.
case InvalidTypeDeclarationBuilder():
LocatedMessage message = typeDeclarationBuilder.message;
return evaluateArgumentsBefore(
arguments,
buildProblem(message.messageObject, nameToken.charOffset,
nameToken.lexeme.length));
+ // Coverage-ignore(suite): Not run.
case TypeAliasBuilder():
case NominalVariableBuilder():
case StructuralVariableBuilder():
@@ -6658,6 +6740,7 @@
List<TypeBuilder>? unaliasedTypeArgumentBuilders =
aliasBuilder.unaliasTypeArguments(const []);
if (unaliasedTypeArgumentBuilders == null) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(eernst): This is a wrong number of type arguments,
// occurring indirectly (in an alias of an alias, etc.).
return evaluateArgumentsBefore(
@@ -6677,11 +6760,17 @@
assert(forest.argumentsTypeArguments(arguments).isEmpty);
forest.argumentsSetTypeArguments(arguments, dartTypeArguments);
case TypeAliasBuilder():
+ // Coverage-ignore(suite): Not run.
case NominalVariableBuilder():
+ // Coverage-ignore(suite): Not run.
case StructuralVariableBuilder():
+ // Coverage-ignore(suite): Not run.
case ExtensionBuilder():
+ // Coverage-ignore(suite): Not run.
case InvalidTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -6712,6 +6801,7 @@
int numberOfTypeParameters =
aliasBuilder.typeVariables?.length ?? 0;
if (numberOfTypeParameters != typeArgumentBuilders.length) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(eernst): Use position of type arguments, not nameToken.
return evaluateArgumentsBefore(
arguments,
@@ -6724,6 +6814,7 @@
List<TypeBuilder>? unaliasedTypeArgumentBuilders =
aliasBuilder.unaliasTypeArguments(typeArgumentBuilders);
if (unaliasedTypeArgumentBuilders == null) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(eernst): This is a wrong number of type arguments,
// occurring indirectly (in an alias of an alias, etc.).
return evaluateArgumentsBefore(
@@ -6760,6 +6851,7 @@
forest.argumentsSetTypeArguments(arguments, []);
} else {
if (forest.argumentsTypeArguments(arguments).isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
// No type arguments provided to unaliased class, use defaults.
List<DartType> result = new List<DartType>.generate(
typeVariables.length,
@@ -6776,7 +6868,9 @@
case StructuralVariableBuilder():
case ExtensionBuilder():
case InvalidTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -6843,6 +6937,7 @@
if (constructorBuilder == null) {
// Not found. Reported below.
} else if (constructorBuilder is AmbiguousMemberBuilder) {
+ // Coverage-ignore-block(suite): Not run.
message = constructorBuilder.message
.withLocation(uri, charOffset, noLength);
} else {
@@ -6869,6 +6964,7 @@
case StructuralVariableBuilder():
case ExtensionBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -6888,6 +6984,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleConstFactory(Token constKeyword) {
debugEvent("ConstFactory");
if (!libraryFeatures.constFunctions.isEnabled) {
@@ -7087,7 +7184,9 @@
} else {
int offset = elseEntry is Expression
? elseEntry.fileOffset
- : offsetForToken(ifToken);
+ :
+ // Coverage-ignore(suite): Not run.
+ offsetForToken(ifToken);
node = new MapLiteralEntry(
buildProblem(fasta.templateExpectedAfterButGot.withArguments(':'),
offset, 1),
@@ -7103,6 +7202,7 @@
node = forest.createIfMapEntry(offsetForToken(ifToken),
condition.expression, thenMapEntry, elseEntry);
} else {
+ // Coverage-ignore-block(suite): Not run.
node = forest.createIfCaseMapEntry(offsetForToken(ifToken),
prelude: [],
expression: condition.expression,
@@ -7121,7 +7221,9 @@
} else {
int offset = thenEntry is Expression
? thenEntry.fileOffset
- : offsetForToken(ifToken);
+ :
+ // Coverage-ignore(suite): Not run.
+ offsetForToken(ifToken);
node = new MapLiteralEntry(
buildProblem(fasta.templateExpectedAfterButGot.withArguments(':'),
offset, 1),
@@ -7153,6 +7255,7 @@
// TODO(cstefantsova): Replace the following no-op with the node for
// handling null-aware elements.
if (!libraryFeatures.nullAwareElements.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(
templateExperimentNotEnabledOffByDefault
.withArguments(ExperimentalFlag.nullAwareElements.name),
@@ -7256,6 +7359,7 @@
} else {
assert(
identifier is ParserRecovery,
+ // Coverage-ignore(suite): Not run.
"Unexpected argument name: "
"${identifier} (${identifier.runtimeType})");
push(identifier);
@@ -7282,6 +7386,7 @@
// scope?
Builder? existing = scope.lookupLocalMember(name.name, setter: false);
if (existing != null) {
+ // Coverage-ignore-block(suite): Not run.
reportDuplicatedDeclaration(existing, name.name, name.nameOffset);
}
push(new FunctionDeclarationImpl(
@@ -7513,7 +7618,9 @@
/* break target = */ ValueKinds.BreakTarget,
]));
Condition condition = pop() as Condition;
- assert(condition.patternGuard == null,
+ assert(
+ condition.patternGuard == null,
+ // Coverage-ignore(suite): Not run.
"Unexpected pattern in do statement: ${condition.patternGuard}.");
Expression expression = condition.expression;
Statement body = popStatement();
@@ -7549,6 +7656,7 @@
if (scope.parent != null) {
enterLocalScope(scope.parent!);
} else {
+ // Coverage-ignore-block(suite): Not run.
createAndEnterLocalScope(
debugName: 'forIn', kind: ScopeKind.statementLocalScope);
}
@@ -7785,6 +7893,7 @@
JumpTarget breakTarget = exitBreakTarget()!;
List<BreakStatementImpl>? continueStatements;
if (continueTarget.hasUsers) {
+ // Coverage-ignore-block(suite): Not run.
LabeledStatement labeledStatement = forest.createLabeledStatement(body);
continueStatements =
continueTarget.resolveContinues(forest, labeledStatement);
@@ -7815,6 +7924,7 @@
typeInferrer.assignedVariables
.storeInfo(forInStatement, assignedVariablesNodeInfo);
if (continueStatements != null) {
+ // Coverage-ignore-block(suite): Not run.
for (BreakStatementImpl continueStatement in continueStatements) {
continueStatement.targetStatement = forInStatement;
}
@@ -7899,6 +8009,7 @@
push(forest.createRethrowStatement(
offsetForToken(rethrowToken), offsetForToken(endToken)));
} else {
+ // Coverage-ignore-block(suite): Not run.
push(new ExpressionStatement(buildProblem(fasta.messageRethrowNotCatch,
offsetForToken(rethrowToken), lengthForToken(rethrowToken)))
..fileOffset = offsetForToken(rethrowToken));
@@ -7930,7 +8041,9 @@
]));
Statement body = popStatement();
Condition condition = pop() as Condition;
- assert(condition.patternGuard == null,
+ assert(
+ condition.patternGuard == null,
+ // Coverage-ignore(suite): Not run.
"Unexpected pattern in while statement: ${condition.patternGuard}.");
Expression expression = condition.expression;
JumpTarget continueTarget = exitContinueTarget()!;
@@ -8013,6 +8126,7 @@
conditionLastToken = nextToken;
}
if (conditionLastToken.isEof) {
+ // Coverage-ignore-block(suite): Not run.
endOffset = startOffset = -1;
} else {
endOffset = conditionLastToken.offset + conditionLastToken.length;
@@ -8125,6 +8239,7 @@
if (scope.hasLocalLabel(labelName)) {
// TODO(ahe): Should validate this is a goto target.
if (!scope.claimLabel(labelName)) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(
fasta.templateDuplicateLabelInSwitchStatement
.withArguments(labelName),
@@ -8349,6 +8464,7 @@
assert(
scope.kind == ScopeKind.switchCase ||
scope.kind == ScopeKind.jointVariables,
+ // Coverage-ignore(suite): Not run.
"Expected the current scope to be of kind '${ScopeKind.switchCase}' "
"or '${ScopeKind.jointVariables}', but got '${scope.kind}.");
Map<String, List<int>>? usedNamesOffsets = scope.usedNames;
@@ -8504,7 +8620,9 @@
exitSwitchScope();
exitLocalScope();
Condition condition = pop() as Condition;
- assert(condition.patternGuard == null,
+ assert(
+ condition.patternGuard == null,
+ // Coverage-ignore(suite): Not run.
"Unexpected pattern in switch statement: ${condition.patternGuard}.");
Expression expression = condition.expression;
Statement switchStatement;
@@ -8519,6 +8637,7 @@
if (switchCase is PatternSwitchCase) {
patternSwitchCase = switchCase;
} else {
+ // Coverage-ignore-block(suite): Not run.
List<PatternGuard> patterns = new List<PatternGuard>.generate(
switchCase.expressions.length, (int index) {
return forest.createPatternGuard(
@@ -8648,7 +8767,9 @@
List<SwitchExpressionCase> cases = pop() as List<SwitchExpressionCase>;
Condition condition = pop() as Condition;
- assert(condition.patternGuard == null,
+ assert(
+ condition.patternGuard == null,
+ // Coverage-ignore(suite): Not run.
"Unexpected pattern in switch expression: ${condition.patternGuard}.");
Expression expression = condition.expression;
push(forest.createSwitchExpression(
@@ -8735,12 +8856,14 @@
push(problemInLoopOrSwitch = buildProblemStatement(
fasta.messageBreakOutsideOfLoop, breakKeyword.charOffset));
} else if (target == null || !target.isBreakTarget) {
+ // Coverage-ignore-block(suite): Not run.
Token labelToken = breakKeyword.next!;
push(problemInLoopOrSwitch = buildProblemStatement(
fasta.templateInvalidBreakTarget.withArguments(name!),
labelToken.charOffset,
length: labelToken.length));
} else if (target.functionNestingLevel != functionNestingLevel) {
+ // Coverage-ignore-block(suite): Not run.
push(buildProblemTargetOutsideLocalFunction(name, breakKeyword));
} else {
Statement statement =
@@ -8750,6 +8873,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
Statement buildProblemTargetOutsideLocalFunction(
String? name, Token keyword) {
Statement problem;
@@ -8804,16 +8928,19 @@
}
}
if (target == null) {
+ // Coverage-ignore-block(suite): Not run.
push(problemInLoopOrSwitch = buildProblemStatement(
fasta.messageContinueWithoutLabelInCase, continueKeyword.charOffset,
length: continueKeyword.length));
} else if (!target.isContinueTarget) {
+ // Coverage-ignore-block(suite): Not run.
Token labelToken = continueKeyword.next!;
push(problemInLoopOrSwitch = buildProblemStatement(
fasta.templateInvalidContinueTarget.withArguments(name!),
labelToken.charOffset,
length: labelToken.length));
} else if (target.functionNestingLevel != functionNestingLevel) {
+ // Coverage-ignore-block(suite): Not run.
push(buildProblemTargetOutsideLocalFunction(name, continueKeyword));
} else {
Statement statement = forest.createContinueStatement(
@@ -8906,6 +9033,7 @@
TypeVariableBuilderBase variable = typeVariables[index];
variable.bound = bound;
if (variance != null) {
+ // Coverage-ignore-block(suite): Not run.
if (!libraryFeatures.variance.isEnabled) {
reportVarianceModifierNotEnabled(variance);
}
@@ -8938,7 +9066,11 @@
libraryBuilder.loader.target.objectClassBuilder,
libraryBuilder.loader.target.dynamicType);
}
- for (int i = 0; i < unboundTypeVariables.length; ++i) {
+ for (int i = 0;
+ i < unboundTypeVariables.length;
+ // Coverage-ignore(suite): Not run.
+ ++i) {
+ // Coverage-ignore-block(suite): Not run.
unboundTypeVariables[i].finish(
libraryBuilder,
libraryBuilder.loader.target.objectClassBuilder,
@@ -8991,6 +9123,7 @@
expression, message.withLocation(uri, fileOffset, length),
context: context);
} else {
+ // Coverage-ignore-block(suite): Not run.
addProblem(message, fileOffset, length, context: context);
return expression;
}
@@ -9026,6 +9159,7 @@
context: context, suppressMessage: suppressMessage));
}
+ // Coverage-ignore(suite): Not run.
Statement wrapInProblemStatement(Statement statement, Message message) {
// TODO(askesc): Produce explicit error statement wrapping the original.
// See [issue 29717](https://github.com/dart-lang/sdk/issues/29717)
@@ -9147,6 +9281,7 @@
DartType fieldType = _context.substituteFieldType(builder.fieldType);
if (!typeEnvironment.isSubtypeOf(
formalType, fieldType, SubtypeCheckMode.withNullabilities)) {
+ // Coverage-ignore-block(suite): Not run.
libraryBuilder.addProblem(
fasta.templateInitializingFormalTypeMismatch
.withArguments(name, formalType, builder.fieldType),
@@ -9230,12 +9365,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleSymbolVoid(Token token) {
debugEvent("SymbolVoid");
push(new SimpleIdentifier(token));
}
@override
+ // Coverage-ignore(suite): Not run.
void handleInvalidFunctionBody(Token token) {
if (_context.isNativeMethod) {
push(NullValues.FunctionBody);
@@ -9380,6 +9517,7 @@
List<Expression> expressions =
new List<Expression>.of(forest.argumentsPositional(arguments));
for (NamedExpression named in forest.argumentsNamed(arguments)) {
+ // Coverage-ignore-block(suite): Not run.
expressions.add(named.value);
}
for (Expression argument in expressions.reversed) {
@@ -9542,6 +9680,7 @@
List<TypeBuilder>? unresolvedTypes, TypeUse typeUse,
{required bool allowPotentiallyConstantType}) {
if (unresolvedTypes == null) {
+ // Coverage-ignore-block(suite): Not run.
return <DartType>[];
}
return new List<DartType>.generate(
@@ -9718,6 +9857,7 @@
case '>=':
kind = RelationalPatternKind.greaterThanEqual;
break;
+ // Coverage-ignore(suite): Not run.
default:
internalProblem(
fasta.templateInternalProblemUnhandled
@@ -9832,7 +9972,9 @@
DartType? patternType = type?.build(libraryBuilder, TypeUse.variableType);
// Note: if `default` appears in a switch expression, parser error recovery
// treats it as a wildcard pattern.
- assert(wildcard.lexeme == '_' || wildcard.lexeme == 'default');
+ assert(wildcard.lexeme == '_' ||
+ // Coverage-ignore(suite): Not run.
+ wildcard.lexeme == 'default');
push(forest.createWildcardPattern(wildcard.charOffset, patternType));
}
@@ -10040,12 +10182,15 @@
JumpTargetKind.Continue, functionNestingLevel, fileUri, charOffset);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasUsers => breakTarget.hasUsers || continueTarget.hasUsers;
@override
+ // Coverage-ignore(suite): Not run.
List<Statement> get users => unsupported("users", charOffset, fileUri);
@override
+ // Coverage-ignore(suite): Not run.
JumpTargetKind get kind => unsupported("kind", charOffset, fileUri);
@override
@@ -10068,23 +10213,27 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void addGoto(Statement statement) {
unsupported("addGoto", charOffset, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
void resolveBreaks(
Forest forest, LabeledStatement target, Statement targetStatement) {
breakTarget.resolveBreaks(forest, target, targetStatement);
}
@override
+ // Coverage-ignore(suite): Not run.
List<BreakStatementImpl>? resolveContinues(
Forest forest, LabeledStatement target) {
return continueTarget.resolveContinues(forest, target);
}
@override
+ // Coverage-ignore(suite): Not run.
void resolveGotos(Forest forest, SwitchCase target) {
unsupported("resolveGotos", charOffset, fileUri);
}
@@ -10213,7 +10362,11 @@
return body;
} else {
return new Block(<Statement>[
- if (statement is Block) ...statement.statements else statement,
+ if (statement is Block)
+ ...statement // Coverage-ignore(suite): Not run.
+ .statements
+ else
+ statement,
body
])
..fileOffset = statement.fileOffset;
@@ -10238,6 +10391,7 @@
/// )
String debugName(String className, String name, [String? prefix]) {
String result = name.isEmpty ? className : "$className.$name";
+ // Coverage-ignore(suite): Not run.
return prefix == null ? result : "$prefix.$result";
}
@@ -10245,10 +10399,13 @@
// of objects can be anticipated and handle these directly.
String getNodeName(Object node) {
if (node is Identifier) {
+ // Coverage-ignore-block(suite): Not run.
return node.name;
} else if (node is Builder) {
return node.fullNameForErrors;
- } else if (node is QualifiedName) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (node is QualifiedName) {
return flattenName(node, node.charOffset, null);
} else {
return unhandled("${node.runtimeType}", "getNodeName", -1, null);
@@ -10292,7 +10449,9 @@
..hasBeenInferred = node.hasBeenInferred;
bodyBuilder.redirectingFactoryInvocations.add(result);
return result;
- } else if (node is TypeAliasedFactoryInvocation) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (node is TypeAliasedFactoryInvocation) {
TypeAliasedFactoryInvocation result = new TypeAliasedFactoryInvocation(
node.typeAliasBuilder, node.target, clone(node.arguments),
isConst: node.isConst)
@@ -10300,12 +10459,14 @@
bodyBuilder.typeAliasedFactoryInvocations.add(result);
return result;
}
+ // Coverage-ignore(suite): Not run.
return super.visitStaticInvocation(node);
}
@override
TreeNode visitConstructorInvocation(ConstructorInvocation node) {
if (node is TypeAliasedConstructorInvocation) {
+ // Coverage-ignore-block(suite): Not run.
TypeAliasedConstructorInvocation result =
new TypeAliasedConstructorInvocation(
node.typeAliasBuilder, node.target, clone(node.arguments),
@@ -10323,6 +10484,7 @@
return ArgumentsImpl.clone(node, node.positional.map(clone).toList(),
node.named.map(clone).toList(), node.types.map(visitType).toList());
}
+ // Coverage-ignore(suite): Not run.
return super.visitArguments(node);
}
}
@@ -10344,11 +10506,13 @@
if (member == null) {
return true;
}
+ // Coverage-ignore-block(suite): Not run.
_FindChildVisitor visitor = new _FindChildVisitor(node);
member.accept(visitor);
return !visitor.foundNode;
}
+// Coverage-ignore(suite): Not run.
class _FindChildVisitor extends VisitorDefault<void> with VisitorVoidMixin {
final TreeNode soughtNode;
bool foundNode = false;
diff --git a/pkg/front_end/lib/src/kernel/body_builder_context.dart b/pkg/front_end/lib/src/kernel/body_builder_context.dart
index 9762d63..95db073 100644
--- a/pkg/front_end/lib/src/kernel/body_builder_context.dart
+++ b/pkg/front_end/lib/src/kernel/body_builder_context.dart
@@ -109,16 +109,22 @@
bool get isConstructor => false;
+ // Coverage-ignore(suite): Not run.
bool get isExternalConstructor => false;
+ // Coverage-ignore(suite): Not run.
bool get isExternalFunction => false;
+ // Coverage-ignore(suite): Not run.
bool get isSetter => false;
+ // Coverage-ignore(suite): Not run.
bool get isConstConstructor => false;
+ // Coverage-ignore(suite): Not run.
bool get isFactory => false;
+ // Coverage-ignore(suite): Not run.
bool get isNativeMethod => false;
bool get isDeclarationInstanceContext {
@@ -151,10 +157,13 @@
ConstantContext get constantContext => ConstantContext.none;
+ // Coverage-ignore(suite): Not run.
bool get isLateField => false;
+ // Coverage-ignore(suite): Not run.
bool get isAbstractField => false;
+ // Coverage-ignore(suite): Not run.
bool get isExternalField => false;
bool get isMixinClass => _declarationContext.isMixinClass;
@@ -216,6 +225,7 @@
throw new UnsupportedError("${runtimeType}.memberCharOffset");
}
+ // Coverage-ignore(suite): Not run.
AugmentSuperTarget? get augmentSuperTarget {
return null;
}
@@ -241,6 +251,7 @@
return new _SourceClassBodyBuilderDeclarationContext(
libraryBuilder, declarationBuilder);
} else if (declarationBuilder is DillClassBuilder) {
+ // Coverage-ignore-block(suite): Not run.
return new _DillClassBodyBuilderDeclarationContext(
libraryBuilder, declarationBuilder);
} else if (declarationBuilder is SourceExtensionTypeDeclarationBuilder) {
@@ -286,6 +297,7 @@
bool get isMixinClass => false;
+ // Coverage-ignore(suite): Not run.
bool get isEnumClass => false;
String get className {
@@ -304,6 +316,7 @@
bool get declaresConstConstructor => false;
+ // Coverage-ignore(suite): Not run.
bool isObjectClass(CoreTypes coreTypes) => false;
}
@@ -415,6 +428,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _DillClassBodyBuilderDeclarationContext
extends BodyBuilderDeclarationContext
with _DeclarationBodyBuilderDeclarationContextMixin {
@@ -506,6 +520,7 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
@@ -530,6 +545,7 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
@@ -546,6 +562,7 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
@@ -562,6 +579,7 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
@@ -581,6 +599,7 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
@@ -596,6 +615,7 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
@@ -715,6 +735,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool get isNativeMethod {
return _member.isNative;
}
@@ -979,9 +1000,11 @@
inConstFields: inConstFields);
@override
+ // Coverage-ignore(suite): Not run.
bool get hasFormalParameters => false;
}
+// Coverage-ignore(suite): Not run.
class ExpressionCompilerProcedureBodyBuildContext extends BodyBuilderContext
with _MemberBodyBuilderContext<SourceProcedureBuilder> {
@override
diff --git a/pkg/front_end/lib/src/kernel/collections.dart b/pkg/front_end/lib/src/kernel/collections.dart
index a09b031..6df4385 100644
--- a/pkg/front_end/lib/src/kernel/collections.dart
+++ b/pkg/front_end/lib/src/kernel/collections.dart
@@ -24,19 +24,23 @@
/// Spread and control-flow elements are not expressions and do not have a
/// static type.
@override
+ // Coverage-ignore(suite): Not run.
DartType getStaticType(StaticTypeContext context) {
return unsupported("getStaticType", fileOffset, getFileUri(this));
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getStaticTypeInternal(StaticTypeContext context) {
return unsupported("getStaticTypeInternal", fileOffset, getFileUri(this));
}
@override
+ // Coverage-ignore(suite): Not run.
R accept<R>(ExpressionVisitor<R> v) => v.visitAuxiliaryExpression(this);
@override
+ // Coverage-ignore(suite): Not run.
R accept1<R, A>(ExpressionVisitor1<R, A> v, A arg) =>
v.visitAuxiliaryExpression(this, arg);
@@ -67,17 +71,20 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
expression.accept(v);
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
expression = v.transform(expression);
expression.parent = this;
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
expression = v.transform(expression);
expression.parent = this;
@@ -96,6 +103,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('...');
if (isNullAware) {
@@ -118,6 +126,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
condition.accept(v);
then.accept(v);
@@ -125,6 +134,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
condition = v.transform(condition);
condition.parent = this;
@@ -137,6 +147,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
condition = v.transform(condition);
condition.parent = this;
@@ -161,6 +172,7 @@
MapLiteralEntry? otherwiseEntry;
Expression? otherwise = this.otherwise;
if (otherwise != null) {
+ // Coverage-ignore-block(suite): Not run.
if (otherwise is ControlFlowElement) {
ControlFlowElement otherwiseElement = otherwise;
otherwiseEntry = otherwiseElement.toMapLiteralEntry(onConvertElement);
@@ -179,6 +191,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('if (');
printer.writeExpression(condition);
@@ -206,6 +219,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
visitList(variables, v);
condition?.accept(v);
@@ -214,6 +228,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
v.transformList(variables, this);
if (condition != null) {
@@ -226,6 +241,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
v.transformVariableDeclarationList(variables, this);
if (condition != null) {
@@ -260,6 +276,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('for (');
for (int index = 0; index < variables.length; index++) {
@@ -298,7 +315,9 @@
syntheticAssignment?.parent = this;
expressionEffects?.parent = this;
body.parent = this;
- problem?.parent = this;
+ problem
+ // Coverage-ignore(suite): Not run.
+ ?.parent = this;
}
Statement? get prologue => syntheticAssignment != null
@@ -307,6 +326,7 @@
: expressionEffects;
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
variable.accept(v);
iterable.accept(v);
@@ -317,6 +337,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
variable = v.transform(variable);
variable.parent = this;
@@ -339,6 +360,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
variable = v.transform(variable);
variable.parent = this;
@@ -383,6 +405,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter state) {
// TODO(johnniwinther): Implement this.
}
@@ -410,13 +433,16 @@
}
@override
+ // Coverage-ignore(suite): Not run.
R accept<R>(TreeVisitor<R> v) => v.visitMapLiteralEntry(this);
@override
+ // Coverage-ignore(suite): Not run.
R accept1<R, A>(TreeVisitor1<R, A> v, A arg) =>
v.visitMapLiteralEntry(this, arg);
@override
+ // Coverage-ignore(suite): Not run.
String toStringInternal() => toText(defaultAstTextStrategy);
}
@@ -436,17 +462,20 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
expression.accept(v);
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
expression = v.transform(expression);
expression.parent = this;
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
expression = v.transform(expression);
expression.parent = this;
@@ -458,6 +487,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('...');
expression.toTextInternal(printer);
@@ -477,6 +507,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
condition.accept(v);
then.accept(v);
@@ -484,6 +515,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
condition = v.transform(condition);
condition.parent = this;
@@ -496,6 +528,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
condition = v.transform(condition);
condition.parent = this;
@@ -513,6 +546,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('if (');
condition.toTextInternal(printer);
@@ -540,6 +574,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
visitList(variables, v);
condition?.accept(v);
@@ -548,6 +583,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
v.transformList(variables, this);
if (condition != null) {
@@ -560,6 +596,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
v.transformVariableDeclarationList(variables, this);
if (condition != null) {
@@ -577,6 +614,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('for (');
for (int index = 0; index < variables.length; index++) {
@@ -615,7 +653,9 @@
syntheticAssignment?.parent = this;
expressionEffects?.parent = this;
body.parent = this;
- problem?.parent = this;
+ problem
+ // Coverage-ignore(suite): Not run.
+ ?.parent = this;
}
Statement? get prologue => syntheticAssignment != null
@@ -624,6 +664,7 @@
: expressionEffects;
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
variable.accept(v);
iterable.accept(v);
@@ -634,6 +675,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
variable = v.transform(variable);
variable.parent = this;
@@ -656,6 +698,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
variable = v.transform(variable);
variable.parent = this;
@@ -683,6 +726,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter state) {
// TODO(johnniwinther): Implement this.
}
@@ -712,7 +756,9 @@
convertToElement(entry.then, helper, onConvertMapEntry),
entry.otherwise == null
? null
- : convertToElement(entry.otherwise!, helper, onConvertMapEntry))
+ :
+ // Coverage-ignore(suite): Not run.
+ convertToElement(entry.otherwise!, helper, onConvertMapEntry))
..fileOffset = entry.fileOffset;
onConvertMapEntry(entry, result);
return result;
@@ -725,7 +771,9 @@
then: convertToElement(entry.then, helper, onConvertMapEntry),
otherwise: entry.otherwise == null
? null
- : convertToElement(entry.otherwise!, helper, onConvertMapEntry))
+ :
+ // Coverage-ignore(suite): Not run.
+ convertToElement(entry.otherwise!, helper, onConvertMapEntry))
..matchedValueType = entry.matchedValueType
..fileOffset = entry.fileOffset;
onConvertMapEntry(entry, result);
@@ -775,6 +823,7 @@
return key;
}
}
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How can this be triggered? This will fail if
// encountered in top level inference.
return helper!.buildProblem(
@@ -794,12 +843,14 @@
if (element is IfCaseElement) {
return isConvertibleToMapEntry(element.then) &&
(element.otherwise == null ||
+ // Coverage-ignore(suite): Not run.
isConvertibleToMapEntry(element.otherwise!));
}
if (element is ForElement) {
return isConvertibleToMapEntry(element.body);
}
if (element is PatternForElement) {
+ // Coverage-ignore-block(suite): Not run.
return isConvertibleToMapEntry(element.body);
}
if (element is ForInElement) {
@@ -841,7 +892,9 @@
then: convertToMapEntry(element.then, helper, onConvertElement),
otherwise: element.otherwise == null
? null
- : convertToMapEntry(element.otherwise!, helper, onConvertElement))
+ :
+ // Coverage-ignore(suite): Not run.
+ convertToMapEntry(element.otherwise!, helper, onConvertElement))
..matchedValueType = element.matchedValueType
..fileOffset = element.fileOffset;
onConvertElement(element, result);
@@ -882,6 +935,7 @@
onConvertElement(element, result);
return result;
}
+ // Coverage-ignore(suite): Not run.
return new MapLiteralEntry(
helper.buildProblem(
templateExpectedAfterButGot.withArguments(':'),
diff --git a/pkg/front_end/lib/src/kernel/combined_member_signature.dart b/pkg/front_end/lib/src/kernel/combined_member_signature.dart
index eb3dc87..42292cf 100644
--- a/pkg/front_end/lib/src/kernel/combined_member_signature.dart
+++ b/pkg/front_end/lib/src/kernel/combined_member_signature.dart
@@ -202,7 +202,10 @@
/// different type.
bool get neededLegacyErasure {
_ensureCombinedMemberSignatureType();
- return _neededLegacyErasureIndices?.contains(canonicalMemberIndex) ?? false;
+ return _neededLegacyErasureIndices
+ // Coverage-ignore(suite): Not run.
+ ?.contains(canonicalMemberIndex) ??
+ false;
}
/// Returns `true` if nnbd top merge and normalization was needed to compute
@@ -261,6 +264,7 @@
norm(_coreTypes, getMemberType(index)));
assert(
_combinedMemberSignatureType != null,
+ // Coverage-ignore(suite): Not run.
"No combined member signature found for "
"${_mutualSubtypes!.values.map((int i) => getMemberType(i))} "
"for members ${members}");
@@ -364,7 +368,9 @@
}
}
return instantiator.substitute(type.withoutTypeParameters);
- } else if (typeParameterCount != 0) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (typeParameterCount != 0) {
return null;
}
return type;
@@ -412,6 +418,7 @@
combinedMemberSignatureType as FunctionType,
copyLocation: copyLocation);
break;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
throw new UnsupportedError(
'Unexpected canonical member kind ${member.kind} for $member');
@@ -447,6 +454,7 @@
int startFileOffset;
int fileOffset;
if (copyLocation) {
+ // Coverage-ignore-block(suite): Not run.
fileUri = member.fileUri;
startFileOffset =
member is Procedure ? member.fileStartOffset : member.fileOffset;
@@ -486,6 +494,7 @@
int startFileOffset;
int fileOffset;
if (copyLocation) {
+ // Coverage-ignore-block(suite): Not run.
fileUri = member.fileUri;
startFileOffset =
member is Procedure ? member.fileStartOffset : member.fileOffset;
@@ -504,7 +513,9 @@
type: type, isCovariantByDeclaration: isCovariantByDeclaration)
..isCovariantByClass = isCovariantByClass
..fileOffset = copyLocation
- ? parameter?.fileOffset ?? fileOffset
+ ?
+ // Coverage-ignore(suite): Not run.
+ parameter?.fileOffset ?? fileOffset
: fileOffset
]),
isAbstract: true,
@@ -531,6 +542,7 @@
int startFileOffset;
int fileOffset;
if (copyLocation) {
+ // Coverage-ignore-block(suite): Not run.
fileUri = procedure.fileUri;
startFileOffset = procedure.fileStartOffset;
fileOffset = procedure.fileOffset;
@@ -554,7 +566,11 @@
initializer: cloner.cloneOptional(parameter.initializer))
..hasDeclaredInitializer = parameter.hasDeclaredInitializer
..isCovariantByClass = parameter.isCovariantByClass
- ..fileOffset = copyLocation ? parameter.fileOffset : fileOffset);
+ ..fileOffset = copyLocation
+ ?
+ // Coverage-ignore(suite): Not run.
+ parameter.fileOffset
+ : fileOffset);
}
List<VariableDeclaration> namedParameters = [];
int namedParameterCount = function.namedParameters.length;
@@ -568,7 +584,11 @@
initializer: cloner.cloneOptional(parameter.initializer))
..hasDeclaredInitializer = parameter.hasDeclaredInitializer
..isCovariantByClass = parameter.isCovariantByClass
- ..fileOffset = copyLocation ? parameter.fileOffset : fileOffset);
+ ..fileOffset = copyLocation
+ ?
+ // Coverage-ignore(suite): Not run.
+ parameter.fileOffset
+ : fileOffset);
} else if (namedParameterCount > 1) {
Map<String, NamedType> namedTypes = {};
for (NamedType namedType in functionType.namedParameters) {
@@ -584,7 +604,11 @@
initializer: cloner.cloneOptional(parameter.initializer))
..hasDeclaredInitializer = parameter.hasDeclaredInitializer
..isCovariantByClass = parameter.isCovariantByClass
- ..fileOffset = copyLocation ? parameter.fileOffset : fileOffset);
+ ..fileOffset = copyLocation
+ ?
+ // Coverage-ignore(suite): Not run.
+ parameter.fileOffset
+ : fileOffset);
}
}
return new Procedure(
diff --git a/pkg/front_end/lib/src/kernel/const_conditional_simplifier.dart b/pkg/front_end/lib/src/kernel/const_conditional_simplifier.dart
index 1d4be91..23e3148 100644
--- a/pkg/front_end/lib/src/kernel/const_conditional_simplifier.dart
+++ b/pkg/front_end/lib/src/kernel/const_conditional_simplifier.dart
@@ -30,7 +30,9 @@
ClassHierarchy? classHierarchy,
bool removeAsserts = false,
}) : _removeAsserts = removeAsserts {
+ // Coverage-ignore(suite): Not run.
coreTypes ??= new CoreTypes(_component);
+ // Coverage-ignore(suite): Not run.
classHierarchy ??= new ClassHierarchy(_component, coreTypes);
_typeEnvironment = new TypeEnvironment(coreTypes, classHierarchy);
constantEvaluator = new _ConstantEvaluator(
@@ -64,7 +66,11 @@
super.visitConditionalExpression(node, removalSentinel);
Constant? condition = _evaluate(node.condition);
if (condition is! BoolConstant) return node;
- return condition.value ? node.then : node.otherwise;
+ return condition.value
+ ? node.then
+ :
+ // Coverage-ignore(suite): Not run.
+ node.otherwise;
}
@override
@@ -72,6 +78,7 @@
super.visitIfStatement(node, removalSentinel);
Constant? condition = _evaluate(node.condition);
if (condition is! BoolConstant) return node;
+ // Coverage-ignore(suite): Not run.
if (condition.value) {
return node.then;
} else {
@@ -80,6 +87,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TreeNode visitAssertBlock(AssertBlock node, TreeNode? removalSentinel) {
if (_removeAsserts) {
return removalSentinel ?? new EmptyStatement();
@@ -89,6 +97,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TreeNode visitAssertInitializer(
AssertInitializer node, TreeNode? removalSentinel) {
if (_removeAsserts) {
@@ -101,6 +110,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TreeNode visitAssertStatement(
AssertStatement node, TreeNode? removalSentinel) {
if (_removeAsserts) {
@@ -138,11 +148,15 @@
Constant? _evaluateFunctionInvocation(FunctionNode node) {
if (node.typeParameters.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
node.requiredParameterCount != 0 ||
+ // Coverage-ignore(suite): Not run.
node.positionalParameters.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
node.namedParameters.isNotEmpty) {
return null;
}
+ // Coverage-ignore-block(suite): Not run.
Statement? body = node.body;
if (body is! ReturnStatement) return null;
Expression? expression = body.expression;
@@ -171,6 +185,7 @@
Constant? _evaluateStaticFieldGet(Field field) {
if (_shouldNotInline(field)) return null;
if (!field.isFinal) return null;
+ // Coverage-ignore-block(suite): Not run.
Expression? initializer = field.initializer;
if (initializer == null) return null;
return _evaluate(initializer);
@@ -179,16 +194,19 @@
Constant? _lookupStaticFieldGet(Field field) => _staticFieldCache.putIfAbsent(
field, () => _evaluateStaticFieldGet(field));
+ // Coverage-ignore(suite): Not run.
Constant? _evaluateStaticGetter(Procedure getter) {
if (_shouldNotInline(getter)) return null;
return _evaluateFunctionInvocation(getter.function);
}
+ // Coverage-ignore(suite): Not run.
Constant? _lookupStaticGetter(Procedure getter) => _functionCache.putIfAbsent(
getter.function, () => _evaluateStaticGetter(getter));
Constant? _lookupStaticGet(Member target) {
if (target is Field) return _lookupStaticFieldGet(target);
+ // Coverage-ignore(suite): Not run.
return _lookupStaticGetter(target as Procedure);
}
@@ -196,16 +214,19 @@
Constant visitStaticGet(StaticGet node) =>
_lookupStaticGet(node.target) ?? super.visitStaticGet(node);
+ // Coverage-ignore(suite): Not run.
Constant? _evaluateLocalFunctionInvocation(LocalFunctionInvocation node) {
if (_shouldNotInline(node.variable)) return null;
return _evaluateFunctionInvocation(node.localFunction.function);
}
+ // Coverage-ignore(suite): Not run.
Constant? _lookupLocalFunctionInvocation(LocalFunctionInvocation node) =>
_localFunctionCache.putIfAbsent(node.localFunction.function,
() => _evaluateLocalFunctionInvocation(node));
@override
+ // Coverage-ignore(suite): Not run.
Constant visitLocalFunctionInvocation(LocalFunctionInvocation node) =>
_lookupLocalFunctionInvocation(node) ??
super.visitLocalFunctionInvocation(node);
diff --git a/pkg/front_end/lib/src/kernel/constant_collection_builders.dart b/pkg/front_end/lib/src/kernel/constant_collection_builders.dart
index bef9a2e..4410cf8 100644
--- a/pkg/front_end/lib/src/kernel/constant_collection_builders.dart
+++ b/pkg/front_end/lib/src/kernel/constant_collection_builders.dart
@@ -40,9 +40,11 @@
if (constant is AbortConstant) return constant;
Constant spread = evaluator.unlower(constant);
if (evaluator.shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
// Unevaluated spread
parts.add(spread);
} else if (spread == evaluator.nullConstant) {
+ // Coverage-ignore-block(suite): Not run.
// Null spread
return evaluator.createEvaluationErrorConstant(
spreadExpression, messageConstEvalNullValue);
@@ -54,12 +56,14 @@
} else if (spread is SetConstant) {
entries = spread.entries;
} else if (evaluator.backend.isLoweredListConstant(spread)) {
+ // Coverage-ignore-block(suite): Not run.
entries = <Constant>[];
evaluator.backend.forEachLoweredListConstantElement(spread,
(Constant element) {
entries.add(element);
});
} else if (evaluator.backend.isLoweredSetConstant(constant)) {
+ // Coverage-ignore-block(suite): Not run.
entries = <Constant>[];
evaluator.backend.forEachLoweredSetConstantElement(spread,
(Constant element) {
@@ -129,6 +133,7 @@
for (Object part in parts) {
if (part is List<Constant>) {
if (part.isEmpty) continue;
+ // Coverage-ignore-block(suite): Not run.
lists.add(new ConstantExpression(new ListConstant(elementType, part)));
} else if (part is Constant) {
lists.add(evaluator._wrap(part));
@@ -150,6 +155,7 @@
: super(original, elementType, evaluator);
@override
+ // Coverage-ignore(suite): Not run.
SetLiteral makeLiteral(List<Expression> elements) =>
new SetLiteral(elements, isConst: true);
@@ -163,6 +169,7 @@
templateConstEvalElementNotPrimitiveEquality
.withArguments(constant));
} else {
+ // Coverage-ignore-block(suite): Not run.
return evaluator.createEvaluationErrorConstant(context,
templateConstEvalElementImplementsEqual.withArguments(constant));
}
@@ -193,6 +200,7 @@
SetConstant result = new SetConstant(elementType, entries);
return evaluator.lowerSetConstant(result);
}
+ // Coverage-ignore-block(suite): Not run.
List<Expression> sets = <Expression>[];
for (Object part in parts) {
if (part is List<Constant>) {
@@ -235,6 +243,7 @@
Constant value = evaluator._evaluateSubexpression(element.value);
if (value is AbortConstant) return value;
if (evaluator.shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
parts.add(evaluator.unevaluated(
element.key,
new MapLiteral([
@@ -253,9 +262,11 @@
if (constant is AbortConstant) return constant;
Constant spread = evaluator.unlower(constant);
if (evaluator.shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
// Unevaluated spread
parts.add(spread);
} else if (spread == evaluator.nullConstant) {
+ // Coverage-ignore-block(suite): Not run.
// Null spread
return evaluator.createEvaluationErrorConstant(
spreadExpression, messageConstEvalNullValue);
@@ -268,6 +279,7 @@
if (error != null) return error;
}
} else if (evaluator.backend.isLoweredMapConstant(spread)) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant? error;
evaluator.backend.forEachLoweredMapConstantEntry(spread,
(Constant key, Constant value) {
@@ -300,6 +312,7 @@
return evaluator.createEvaluationErrorConstant(keyContext,
templateConstEvalKeyNotPrimitiveEquality.withArguments(key));
} else {
+ // Coverage-ignore-block(suite): Not run.
return evaluator.createEvaluationErrorConstant(
keyContext, templateConstEvalKeyImplementsEqual.withArguments(key));
}
@@ -325,6 +338,7 @@
return evaluator
.lowerMapConstant(new MapConstant(keyType, valueType, entries));
}
+ // Coverage-ignore-block(suite): Not run.
List<Expression> maps = <Expression>[];
for (Object part in parts) {
if (part is List<ConstantMapEntry>) {
diff --git a/pkg/front_end/lib/src/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/kernel/constant_evaluator.dart
index 00176d6..504aa78 100644
--- a/pkg/front_end/lib/src/kernel/constant_evaluator.dart
+++ b/pkg/front_end/lib/src/kernel/constant_evaluator.dart
@@ -346,12 +346,14 @@
if (StaticWeakReferences.isAnnotatedWithWeakReferencePragma(
parent, typeEnvironment.coreTypes)) {
+ // Coverage-ignore-block(suite): Not run.
StaticWeakReferences.validateWeakReferenceDeclaration(
parent, constantEvaluator.errorReporter);
}
final Iterable<InstanceConstant> resourceAnnotations =
ResourceIdentifiers.findResourceAnnotations(parent);
if (resourceAnnotations.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
ResourceIdentifiers.validateResourceIdentifierDeclaration(
parent, constantEvaluator.errorReporter, resourceAnnotations);
}
@@ -453,7 +455,9 @@
evaluateAndTransformWithContext(node, initializer!)..parent = node;
// If this constant is inlined, remove it.
- if (!keepFields && shouldInline(initializer)) {
+ if (!keepFields &&
+ // Coverage-ignore(suite): Not run.
+ shouldInline(initializer)) {
return removalSentinel!;
}
} else {
@@ -511,6 +515,7 @@
}
} else if (target is Procedure) {
if (target.kind == ProcedureKind.Method) {
+ // Coverage-ignore-block(suite): Not run.
return evaluateAndTransformWithContext(node, node);
} else if (target.kind == ProcedureKind.Getter && enableConstFunctions) {
return evaluateAndTransformWithContext(node, node);
@@ -550,6 +555,7 @@
// Handle [StaticGet] of constant fields also when these are not inlined.
expression = (expression.target as Field).initializer!;
} else if (expression is VariableGet && expression.variable.isConst) {
+ // Coverage-ignore-block(suite): Not run.
// Handle [VariableGet] of constant locals also when these are not
// inlined.
expression = expression.variable.initializer!;
@@ -907,6 +913,7 @@
if (isAlwaysExhaustiveType &&
!hasDefault &&
constantEvaluator.evaluationMode != EvaluationMode.strong) {
+ // Coverage-ignore-block(suite): Not run.
if (!node.lastCaseTerminates) {
PatternSwitchCase lastCase = node.cases.last;
Statement body = lastCase.body;
@@ -1179,6 +1186,7 @@
if (labelUser is ContinueSwitchStatement) {
labelUser.target = replacementCase;
} else {
+ // Coverage-ignore-block(suite): Not run.
// TODO(cstefantsova): Handle other label user types.
return throw new UnsupportedError(
"Unexpected label user: ${labelUser.runtimeType}");
@@ -1201,6 +1209,7 @@
if (caseIndex == node.cases.length - 1 &&
needsThrowForNull &&
!node.lastCaseTerminates) {
+ // Coverage-ignore-block(suite): Not run.
LabeledStatement target;
if (node.parent is LabeledStatement) {
target = node.parent as LabeledStatement;
@@ -1214,7 +1223,9 @@
cases.add(createBlock([
...caseVariables,
caseBlock,
- if (breakStatement != null) breakStatement
+ if (breakStatement != null)
+ // Coverage-ignore(suite): Not run.
+ breakStatement
], fileOffset: switchCase.fileOffset));
}
@@ -1226,7 +1237,9 @@
createStringLiteral(
forUnsoundness
? messageUnsoundSwitchStatementError.problemMessage
- : messageNeverReachableSwitchStatementError
+ :
+ // Coverage-ignore(suite): Not run.
+ messageNeverReachableSwitchStatementError
.problemMessage,
fileOffset: node.fileOffset)
], fileOffset: node.fileOffset),
@@ -1270,6 +1283,7 @@
}
if (replacementStatements.length == 1) {
+ // Coverage-ignore-block(suite): Not run.
replacement = replacementStatements.first;
} else {
replacement = new Block(replacementStatements)
@@ -1277,6 +1291,7 @@
}
}
if (outerLabeledStatement != null) {
+ // Coverage-ignore-block(suite): Not run.
outerLabeledStatement.body = replacement..parent = outerLabeledStatement;
replacement = outerLabeledStatement;
}
@@ -1324,14 +1339,17 @@
computeUnreachable: retainDataForTesting);
List<ExhaustivenessError>? reportedErrors;
if (_exhaustivenessDataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
reportedErrors = [];
}
for (ExhaustivenessError error in errors) {
if (error is UnreachableCaseError) {
+ // Coverage-ignore-block(suite): Not run.
reportedErrors?.add(error);
} else if (error is NonExhaustiveError &&
!hasDefault &&
mustBeExhaustive) {
+ // Coverage-ignore(suite): Not run.
reportedErrors?.add(error);
constantEvaluator.errorReporter.report(
constantEvaluator.createLocatedMessageWithOffset(
@@ -1347,6 +1365,7 @@
}
}
if (_exhaustivenessDataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
_exhaustivenessDataForTesting.objectFieldLookup ??= _exhaustivenessCache;
_exhaustivenessDataForTesting.switchResults[replacement] =
new ExhaustivenessResult(type, cases,
@@ -1432,7 +1451,9 @@
// the else-statement is not covered.
createBoolLiteral(true, fileOffset: node.fileOffset);
if (statements.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
expressionEffects.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
statementEffects.isNotEmpty) {
then = createBlock([
...statements,
@@ -1607,7 +1628,9 @@
fileOffset: node.fileOffset),
forErrorHandling: true)),
fileOffset: node.fileOffset),
- ...effects.map((e) => createExpressionStatement(e)),
+ ...effects.map(
+ // Coverage-ignore(suite): Not run.
+ (e) => createExpressionStatement(e)),
];
}
@@ -1628,6 +1651,7 @@
// This avoids unnecessary [BlockExpression]s created by the lowering of
// [PatternAssignment]s for effect.
if (_exhaustivenessDataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
ExhaustivenessResult? result =
_exhaustivenessDataForTesting.switchResults[expression];
if (result != null) {
@@ -1762,6 +1786,7 @@
switchCases.add(switchCase);
}
if (constantEvaluator.evaluationMode != EvaluationMode.strong) {
+ // Coverage-ignore-block(suite): Not run.
switchCases.add(new SwitchCase(
[],
[],
@@ -1854,7 +1879,9 @@
// case.
createBoolLiteral(true, fileOffset: node.fileOffset);
if (statements.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
expressionEffects.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
statementEffects.isNotEmpty) {
tailStatements = [
...statements,
@@ -1904,7 +1931,9 @@
createStringLiteral(
forUnsoundness
? messageUnsoundSwitchExpressionError.problemMessage
- : messageNeverReachableSwitchExpressionError
+ :
+ // Coverage-ignore(suite): Not run.
+ messageNeverReachableSwitchExpressionError
.problemMessage,
fileOffset: node.fileOffset)
], fileOffset: node.fileOffset),
@@ -2008,6 +2037,7 @@
if (allConstant) {
if (hasUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return makeConstantExpression(new UnevaluatedConstant(node), node);
} else {
Constant constant = constantEvaluator.canonicalize(
@@ -2118,6 +2148,7 @@
// arguments are already constant evaluated.
if (StaticWeakReferences.isAnnotatedWithWeakReferencePragma(
node.target, typeEnvironment.coreTypes)) {
+ // Coverage-ignore-block(suite): Not run.
StaticWeakReferences.validateWeakReferenceUse(
node, constantEvaluator.errorReporter);
}
@@ -2129,6 +2160,7 @@
ConstantExpression node, TreeNode? removalSentinel) {
Constant constant = node.constant;
if (constant is UnevaluatedConstant && constantEvaluator.hasEnvironment) {
+ // Coverage-ignore-block(suite): Not run.
Expression expression = constant.expression;
return evaluateAndTransformWithContext(expression, expression);
} else {
@@ -2297,6 +2329,7 @@
bool hasEnvironmentKey(String key) {
if (DartLibrarySupport.isDartLibraryQualifier(key)) {
+ // Coverage-ignore-block(suite): Not run.
return (_supportedLibrariesCache ??= _computeSupportedLibraries())
.containsKey(key);
}
@@ -2309,6 +2342,7 @@
switch (evaluationMode) {
case EvaluationMode.strong:
return norm(coreTypes, type);
+ // Coverage-ignore(suite): Not run.
case EvaluationMode.weak:
type = norm(coreTypes, type);
return computeConstCanonicalType(type, coreTypes) ?? type;
@@ -2319,6 +2353,7 @@
switch (evaluationMode) {
case EvaluationMode.strong:
return types.map((DartType type) => norm(coreTypes, type)).toList();
+ // Coverage-ignore(suite): Not run.
case EvaluationMode.weak:
return types.map((DartType type) {
type = norm(coreTypes, type);
@@ -2330,6 +2365,7 @@
LocatedMessage createLocatedMessage(TreeNode? node, Message message) {
Uri? uri = getFileUri(node);
if (uri == null) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(johnniwinther): Ensure that we always have a uri.
return message.withoutLocation();
}
@@ -2341,6 +2377,7 @@
TreeNode? node, int offset, Message message) {
Uri? uri = getFileUri(node);
if (uri == null) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(johnniwinther): Ensure that we always have a uri.
return message.withoutLocation();
}
@@ -2402,6 +2439,7 @@
locatedMessageActualError
];
if (result.context != null) {
+ // Coverage-ignore-block(suite): Not run.
contextMessages.addAll(result.context!);
}
if (contextNode != null && contextNode != result.node) {
@@ -2455,6 +2493,7 @@
}
if (result is UnevaluatedConstant) {
if (errorOnUnevaluatedConstant) {
+ // Coverage-ignore-block(suite): Not run.
return createEvaluationErrorConstant(node, messageConstEvalUnevaluated);
}
return canonicalize(new UnevaluatedConstant(
@@ -2486,6 +2525,7 @@
// No return statement in function body with void return type.
return new NullConstant();
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
statement,
templateConstEvalError.withArguments(
@@ -2496,7 +2536,9 @@
/// Returns [null] on success and an error-"constant" on failure, as such the
/// return value should be checked.
AbortConstant? executeConstructorBody(Constructor constructor) {
- if (!enableConstFunctions && !inExtensionTypeConstConstructor) {
+ if (!enableConstFunctions &&
+ // Coverage-ignore(suite): Not run.
+ !inExtensionTypeConstConstructor) {
throw new UnsupportedError("Statement evaluation is only supported when "
"in extension type const constructors or when the const functions "
"feature is enabled.");
@@ -2515,6 +2557,7 @@
templateConstEvalError
.withArguments("Constructors can't have a return value."));
} else if (status is! ProceedStatus) {
+ // Coverage-ignore-block(suite): Not run.
return createEvaluationErrorConstant(
constructor,
templateConstEvalError
@@ -2572,6 +2615,7 @@
Constant lower(Constant original, Constant replacement) {
if (!identical(original, replacement)) {
+ // Coverage-ignore-block(suite): Not run.
original = canonicalize(original);
replacement = canonicalize(replacement);
lowered[replacement] = original;
@@ -2835,6 +2879,7 @@
assert(_gotError == null);
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new RecordLiteral([
@@ -2852,6 +2897,7 @@
Constant visitListConcatenation(ListConcatenation node) {
DartType? type = _evaluateDartType(node, node.typeArgument);
if (type == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -2904,6 +2950,7 @@
Constant visitSetConcatenation(SetConcatenation node) {
DartType? type = _evaluateDartType(node, node.typeArgument);
if (type == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -2964,6 +3011,7 @@
Constant visitMapConcatenation(MapConcatenation node) {
DartType? keyType = _evaluateDartType(node, node.keyType);
if (keyType == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -2971,6 +3019,7 @@
assert(_gotError == null);
DartType? valueType = _evaluateDartType(node, node.valueType);
if (valueType == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3033,6 +3082,7 @@
bool isSymbol = klass == coreTypes.internalSymbolClass;
if (isSymbol && shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new ConstructorInvocation(constructor,
@@ -3050,6 +3100,7 @@
if (nameValue is StringConstant) {
return canonicalize(new SymbolConstant(nameValue.value, null));
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(node.arguments.positional.first,
templateConstEvalInvalidSymbolName.withArguments(nameValue));
}
@@ -3065,7 +3116,10 @@
final List<DartType> typeArguments = convertTypes(types);
// Fill in any missing type arguments with "dynamic".
- for (int i = typeArguments.length; i < klass.typeParameters.length; i++) {
+ for (int i = typeArguments.length;
+ i < klass.typeParameters.length;
+ // Coverage-ignore(suite): Not run.
+ i++) {
// Coverage-ignore: Probably unreachable.
typeArguments.add(const DynamicType());
}
@@ -3086,6 +3140,7 @@
constructor, typeArguments, positional, named, node);
if (error != null) return error;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(node, instanceBuilder!.buildUnevaluatedInstance());
}
return canonicalize(instanceBuilder!.buildInstance());
@@ -3117,6 +3172,7 @@
return withNewInstanceBuilder(
node.classNode, convertTypes(node.typeArguments), () {
for (AssertStatement statement in node.asserts) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant? error = checkAssert(statement);
if (error != null) return error;
}
@@ -3133,6 +3189,7 @@
}
if (error != null) return error;
for (Expression value in node.unusedArguments) {
+ // Coverage-ignore-block(suite): Not run.
if (error != null) return error;
Constant constant = _evaluateSubexpression(value);
if (constant is AbortConstant) {
@@ -3145,6 +3202,7 @@
}
if (error != null) return error;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(node, instanceBuilder!.buildUnevaluatedInstance());
}
// We can get here when re-evaluating a previously unevaluated constant.
@@ -3217,6 +3275,7 @@
List<DartType>? types = _evaluateSuperTypeArguments(
init, constructor.enclosingClass.supertype!);
if (types == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3226,6 +3285,7 @@
List<Constant>? positionalArguments =
_evaluatePositionalArguments(init.arguments.positional);
if (positionalArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3234,6 +3294,7 @@
Map<String, Constant>? namedArguments =
_evaluateNamedArguments(init.arguments.named);
if (namedArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3252,6 +3313,7 @@
List<Constant>? positionalArguments =
_evaluatePositionalArguments(init.arguments.positional);
if (positionalArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3261,6 +3323,7 @@
Map<String, Constant>? namedArguments =
_evaluateNamedArguments(init.arguments.named);
if (namedArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3274,6 +3337,7 @@
AbortConstant? error = checkAssert(init.statement);
if (error != null) return error;
} else {
+ // Coverage-ignore-block(suite): Not run.
// Coverage-ignore: Probably unreachable.
// InvalidInitializer or new Initializers.
// InvalidInitializer is (currently) only
@@ -3291,6 +3355,7 @@
}
for (UnevaluatedConstant constant in env.unevaluatedUnreadConstants) {
+ // Coverage-ignore-block(suite): Not run.
instanceBuilder!.unusedArguments.add(_wrap(constant));
}
@@ -3311,6 +3376,7 @@
if (condition is AbortConstant) return condition;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
Expression? message = null;
if (statement.message != null) {
enterLazy();
@@ -3332,6 +3398,7 @@
final Constant message = _evaluateSubexpression(statement.message!);
if (message is AbortConstant) return message;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
instanceBuilder!.asserts.add(new AssertStatement(_wrap(condition),
message: _wrap(message),
conditionStartOffset: statement.conditionStartOffset,
@@ -3350,6 +3417,7 @@
}
}
} else {
+ // Coverage-ignore-block(suite): Not run.
return createEvaluationErrorConstant(
statement.condition,
templateConstEvalInvalidType.withArguments(
@@ -3387,6 +3455,7 @@
_evaluatePositionalArguments(node.arguments.positional);
if (positionalArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3394,6 +3463,7 @@
assert(_gotError == null);
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new DynamicInvocation(
@@ -3438,6 +3508,7 @@
assert(_gotError == null);
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new InstanceInvocation(
@@ -3490,6 +3561,7 @@
_evaluatePositionalArguments(arguments.positional);
if (positional == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3499,6 +3571,7 @@
// Evaluate type arguments of the function invoked.
List<DartType>? types = _evaluateTypeArguments(node, arguments);
if (types == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3509,6 +3582,7 @@
final Map<String, Constant>? named =
_evaluateNamedArguments(arguments.named);
if (named == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3520,6 +3594,7 @@
receiver.function, types, positional, named,
functionEnvironment: receiver.environment);
} else {
+ // Coverage-ignore-block(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalError
@@ -3534,6 +3609,7 @@
final Constant right = _evaluateSubexpression(node.right);
if (right is AbortConstant) return right;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new EqualsCall(_wrap(left), _wrap(right),
@@ -3551,6 +3627,7 @@
if (expression is AbortConstant) return expression;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(node,
new EqualsNull(_wrap(expression))..fileOffset = node.fileOffset);
}
@@ -3572,6 +3649,7 @@
left, left.getType(staticTypeContext)));
}
} else {
+ // Coverage-ignore-block(suite): Not run.
if (left is NullConstant ||
left is BoolConstant ||
left is IntConstant ||
@@ -3600,12 +3678,14 @@
if (receiver is PrimitiveConstant &&
op == 'toString' &&
enableConstFunctions) {
+ // Coverage-ignore-block(suite): Not run.
return new StringConstant(receiver.value.toString());
}
// Handle == and != first (it's common between all types). Since `a != b` is
// parsed as `!(a == b)` it is handled implicitly through ==.
if (positionalArguments.length == 1 && op == '==') {
+ // Coverage-ignore-block(suite): Not run.
final Constant right = positionalArguments[0];
return _handleEquals(node, receiver, right);
}
@@ -3637,6 +3717,7 @@
}
return canonicalize(new StringConstant(receiver.value[index]));
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidBinaryOperandType.withArguments(
@@ -3702,6 +3783,7 @@
return canonicalize(
evaluateBinaryNumericOperation(op, receiver.value, value, node));
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidBinaryOperandType.withArguments(
@@ -3742,6 +3824,7 @@
}
return receiver.entries[index];
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidBinaryOperandType.withArguments(
@@ -3774,6 +3857,7 @@
// Evaluate type arguments of the method invoked.
List<DartType>? typeArguments = _evaluateTypeArguments(node, arguments);
if (typeArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
@@ -3784,13 +3868,17 @@
final Map<String, Constant>? namedArguments =
_evaluateNamedArguments(arguments.named);
if (namedArguments == null) {
+ // Coverage-ignore-block(suite): Not run.
AbortConstant error = _gotError!;
_gotError = null;
return error;
}
assert(_gotError == null);
- if (receiver is FunctionValue && name == Name.callName) {
+ if (receiver is FunctionValue &&
+ // Coverage-ignore(suite): Not run.
+ name == Name.callName) {
+ // Coverage-ignore-block(suite): Not run.
return _handleFunctionInvocation(receiver.function, typeArguments,
positionalArguments, namedArguments,
functionEnvironment: receiver.environment);
@@ -3841,6 +3929,7 @@
final Constant left = _evaluateSubexpression(node.left);
if (left is AbortConstant) return left;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
enterLazy();
Constant right = _evaluateSubexpression(node.right);
if (right is AbortConstant) return right;
@@ -3855,9 +3944,12 @@
final Constant right = _evaluateSubexpression(node.right);
if (right is AbortConstant) return right;
- if (right is BoolConstant || right is UnevaluatedConstant) {
+ if (right is BoolConstant ||
+ // Coverage-ignore(suite): Not run.
+ right is UnevaluatedConstant) {
return right;
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidBinaryOperandType.withArguments(
@@ -3866,6 +3958,7 @@
typeEnvironment.coreTypes.boolNonNullableRawType,
right.getType(staticTypeContext)));
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidMethodInvocation.withArguments(
@@ -3876,9 +3969,12 @@
final Constant right = _evaluateSubexpression(node.right);
if (right is AbortConstant) return right;
- if (right is BoolConstant || right is UnevaluatedConstant) {
+ if (right is BoolConstant ||
+ // Coverage-ignore(suite): Not run.
+ right is UnevaluatedConstant) {
return right;
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidBinaryOperandType.withArguments(
@@ -3887,6 +3983,7 @@
typeEnvironment.coreTypes.boolNonNullableRawType,
right.getType(staticTypeContext)));
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidMethodInvocation.withArguments(
@@ -3914,6 +4011,7 @@
new ConditionalExpression(_wrap(condition), _wrap(then),
_wrap(otherwise), env.substituteType(node.staticType)));
} else {
+ // Coverage-ignore-block(suite): Not run.
return createEvaluationErrorConstant(
node.condition,
templateConstEvalInvalidType.withArguments(
@@ -3957,6 +4055,7 @@
if (receiver is StringConstant && node.name.text == 'length') {
return canonicalize(intFolder.makeIntConstant(receiver.value.length));
} else if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new InstanceGet(node.kind, _wrap(receiver), node.name,
@@ -4016,6 +4115,7 @@
final Constant receiver = _evaluateSubexpression(node.receiver);
if (receiver is AbortConstant) return receiver;
if (receiver is RecordConstant && enableConstFunctions) {
+ // Coverage-ignore-block(suite): Not run.
if (node.index >= receiver.positional.length) {
return new _AbortDueToThrowConstant(node, new StateError('No element'));
}
@@ -4032,6 +4132,7 @@
final Constant receiver = _evaluateSubexpression(node.receiver);
if (receiver is AbortConstant) return receiver;
if (receiver is RecordConstant && enableConstFunctions) {
+ // Coverage-ignore-block(suite): Not run.
Constant? result = receiver.named[node.name];
if (result == null) {
return new _AbortDueToThrowConstant(node, new StateError('No element'));
@@ -4051,12 +4152,15 @@
if (receiver is AbortConstant) return receiver;
if (receiver is StringConstant && node.name.text == 'length') {
return canonicalize(intFolder.makeIntConstant(receiver.value.length));
- } else if (shouldBeUnevaluated) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (shouldBeUnevaluated) {
return unevaluated(
node, new DynamicGet(node.kind, _wrap(receiver), node.name));
} else if (receiver is NullConstant) {
return createEvaluationErrorConstant(node, messageConstEvalNullValue);
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidPropertyGet.withArguments(
@@ -4077,6 +4181,7 @@
Constant visitFunctionTearOff(FunctionTearOff node) {
final Constant receiver = _evaluateSubexpression(node.receiver);
if (receiver is AbortConstant) return receiver;
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalInvalidPropertyGet.withArguments(
@@ -4102,6 +4207,7 @@
final VariableDeclaration variable = node.variable;
if (enableConstFunctions || inExtensionTypeConstConstructor) {
return env.lookupVariable(variable) ??
+ // Coverage-ignore(suite): Not run.
createEvaluationErrorConstant(
node,
templateConstEvalGetterNotFound
@@ -4136,6 +4242,7 @@
if (result != null) {
return result;
}
+ // Coverage-ignore(suite): Not run.
return createEvaluationErrorConstant(
node,
templateConstEvalError
@@ -4166,6 +4273,7 @@
() => evaluateExpressionInContext(target, target.initializer!));
} else if (target is Procedure) {
if (target.kind == ProcedureKind.Method) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(johnniwinther): Remove this. This should never occur.
return canonicalize(new StaticTearOffConstant(target));
} else if (target.kind == ProcedureKind.Getter && enableConstFunctions) {
@@ -4200,9 +4308,11 @@
if (last is StringBuffer) {
last.write(value);
} else {
+ // Coverage-ignore-block(suite): Not run.
concatenated.add(new StringBuffer(value));
}
} else if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
// The constant is either unevaluated or a non-primitive in an
// unevaluated context. In both cases we defer the evaluation and/or
// error reporting till later.
@@ -4215,6 +4325,7 @@
}
}
if (concatenated.length > 1) {
+ // Coverage-ignore-block(suite): Not run.
final List<Expression> expressions =
new List<Expression>.generate(concatenated.length, (int i) {
Object value = concatenated[i];
@@ -4251,7 +4362,9 @@
} else if (defaultValue != null) {
if (defaultValue is BoolConstant) {
boolConstant = makeBoolConstant(defaultValue.value);
- } else if (defaultValue is NullConstant) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (defaultValue is NullConstant) {
boolConstant = nullConstant;
} else {
// Coverage-ignore: Probably unreachable.
@@ -4271,6 +4384,7 @@
if (intFolder.isInt(defaultValue)) {
intConstant = defaultValue;
} else {
+ // Coverage-ignore-block(suite): Not run.
intConstant = nullConstant;
}
} else {
@@ -4285,6 +4399,7 @@
if (defaultValue is StringConstant) {
stringConstant = defaultValue;
} else {
+ // Coverage-ignore-block(suite): Not run.
stringConstant = nullConstant;
}
} else {
@@ -4356,7 +4471,9 @@
} else {
return _handleHasEnvironment(name);
}
- } else if (name is NullConstant) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (name is NullConstant) {
return createEvaluationErrorConstant(
node, messageConstEvalNullValue);
}
@@ -4388,6 +4505,7 @@
return createExpressionErrorConstant(node,
templateNotConstantExpression.withArguments('New expression'));
} else {
+ // Coverage-ignore-block(suite): Not run.
return createEvaluationErrorConstant(
node,
templateNotConstantExpression
@@ -4470,6 +4588,7 @@
final Constant result = executeBody(function.body!);
if (result is NullConstant &&
function.returnType.nullability == Nullability.nonNullable) {
+ // Coverage-ignore-block(suite): Not run.
// Ensure that the evaluated constant returned is not null if the
// function has a non-nullable return type.
return createEvaluationErrorConstant(
@@ -4491,6 +4610,7 @@
final Constant constant = _evaluateSubexpression(node.operand);
if (constant is AbortConstant) return constant;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(node,
new AsExpression(_wrap(constant), env.substituteType(node.type)));
}
@@ -4509,6 +4629,7 @@
final Constant constant = _evaluateSubexpression(node.operand);
if (constant is AbortConstant) return constant;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new IsExpression(_wrap(constant), env.substituteType(node.type))
@@ -4527,6 +4648,7 @@
if (strongMode) {
return isSubtype(constant, type, SubtypeCheckMode.withNullabilities);
} else {
+ // Coverage-ignore-block(suite): Not run.
// In weak checking mode: if e evaluates to a value v and v has runtime
// type S, an instance check e is T occurring in a legacy library or an
// opted-in library is evaluated as follows:
@@ -4556,6 +4678,7 @@
switch (evaluationMode) {
case EvaluationMode.strong:
return makeBoolConstant(performIs(constant, strongMode: true));
+ // Coverage-ignore(suite): Not run.
case EvaluationMode.weak:
return makeBoolConstant(performIs(constant, strongMode: false));
}
@@ -4568,6 +4691,7 @@
if (constant is BoolConstant) {
return makeBoolConstant(constant != trueConstant);
}
+ // Coverage-ignore-block(suite): Not run.
if (shouldBeUnevaluated) {
return unevaluated(node, new Not(_wrap(constant)));
}
@@ -4587,6 +4711,7 @@
return createEvaluationErrorConstant(node, messageConstEvalNonNull);
}
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(node, new NullCheck(_wrap(constant)));
}
return constant;
@@ -4614,6 +4739,7 @@
Constant constant = _evaluateSubexpression(node.expression);
if (constant is AbortConstant) return constant;
if (shouldBeUnevaluated) {
+ // Coverage-ignore-block(suite): Not run.
return unevaluated(
node,
new Instantiation(_wrap(constant),
@@ -4807,6 +4933,7 @@
DartType constantType =
constant.getType(staticTypeContext).extensionTypeErasure;
if (mode == SubtypeCheckMode.ignoringNullabilities) {
+ // Coverage-ignore-block(suite): Not run.
constantType = rawLegacyErasure(constantType) ?? constantType;
}
if (type is RecordType && constant is RecordConstant) {
@@ -4859,6 +4986,7 @@
case EvaluationMode.strong:
result = isSubtype(constant, type, SubtypeCheckMode.withNullabilities);
break;
+ // Coverage-ignore(suite): Not run.
case EvaluationMode.weak:
result =
isSubtype(constant, type, SubtypeCheckMode.ignoringNullabilities);
@@ -4990,7 +5118,9 @@
positional[i] = _wrap(positionalArgs[i]);
}
int i = 0;
- namedArgs.forEach((String name, Constant value) {
+ namedArgs.forEach(
+ // Coverage-ignore(suite): Not run.
+ (String name, Constant value) {
named[i++] = new NamedExpression(name, _wrap(value));
});
return new Arguments(positional, named: named, types: types);
@@ -5097,6 +5227,7 @@
Constant visitStaticSet(StaticSet node) => _notAConstantExpression(node);
@override
+ // Coverage-ignore(suite): Not run.
Constant visitAbstractSuperMethodInvocation(
AbstractSuperMethodInvocation node) =>
_notAConstantExpression(node);
@@ -5106,10 +5237,12 @@
_notAConstantExpression(node);
@override
+ // Coverage-ignore(suite): Not run.
Constant visitAbstractSuperPropertyGet(AbstractSuperPropertyGet node) =>
_notAConstantExpression(node);
@override
+ // Coverage-ignore(suite): Not run.
Constant visitAbstractSuperPropertySet(AbstractSuperPropertySet node) =>
_notAConstantExpression(node);
@@ -5126,12 +5259,14 @@
_notAConstantExpression(node);
@override
+ // Coverage-ignore(suite): Not run.
Constant visitSwitchExpression(SwitchExpression node) {
return createExpressionErrorConstant(
node, templateNotConstantExpression.withArguments('Switch expression'));
}
@override
+ // Coverage-ignore(suite): Not run.
Constant visitPatternAssignment(PatternAssignment node) {
return createExpressionErrorConstant(node,
templateNotConstantExpression.withArguments('Pattern assignment'));
@@ -5153,6 +5288,7 @@
Constant evaluate(Expression expr) => expr.accept(exprEvaluator);
@override
+ // Coverage-ignore(suite): Not run.
ExecutionStatus visitAssertBlock(AssertBlock node) {
if (!exprEvaluator.enableAsserts) return const ProceedStatus();
throw new UnsupportedError(
@@ -5195,6 +5331,7 @@
} while (condition is BoolConstant && condition.value);
if (condition is AbortConstant) {
+ // Coverage-ignore-block(suite): Not run.
return new AbortStatus(condition);
}
assert(condition is BoolConstant);
@@ -5220,6 +5357,7 @@
ExecutionStatus visitIfStatement(IfStatement node) {
Constant condition = evaluate(node.condition);
if (condition is AbortConstant) {
+ // Coverage-ignore-block(suite): Not run.
return new AbortStatus(condition);
}
assert(condition is BoolConstant);
@@ -5259,6 +5397,7 @@
}
if (condition is AbortConstant) {
+ // Coverage-ignore-block(suite): Not run.
return new AbortStatus(condition);
}
assert(condition is BoolConstant);
@@ -5295,6 +5434,7 @@
ExecutionStatus visitSwitchStatement(SwitchStatement node) {
final Constant value = evaluate(node.expression);
if (value is AbortConstant) {
+ // Coverage-ignore-block(suite): Not run.
return new AbortStatus(value);
}
@@ -5388,6 +5528,7 @@
condition = evaluate(node.condition);
}
if (condition is AbortConstant) {
+ // Coverage-ignore-block(suite): Not run.
return new AbortStatus(condition);
}
assert(condition is BoolConstant);
@@ -5395,12 +5536,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExecutionStatus visitForInStatement(ForInStatement node) {
return new AbortStatus(exprEvaluator.createEvaluationErrorConstant(
node, templateConstEvalError.withArguments('For-in statement.')));
}
@override
+ // Coverage-ignore(suite): Not run.
ExecutionStatus visitIfCaseStatement(IfCaseStatement node) {
return new AbortStatus(exprEvaluator.createEvaluationErrorConstant(
node, templateConstEvalError.withArguments('If-case statement.')));
@@ -5413,6 +5556,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExecutionStatus visitPatternVariableDeclaration(
PatternVariableDeclaration node) {
return new AbortStatus(exprEvaluator.createEvaluationErrorConstant(node,
@@ -5420,6 +5564,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExecutionStatus visitYieldStatement(YieldStatement node) {
return new AbortStatus(exprEvaluator.createEvaluationErrorConstant(
node, templateConstEvalError.withArguments('Yield statement.')));
@@ -5558,6 +5703,7 @@
/// The unevaluated constants of variables that were never read.
Iterable<UnevaluatedConstant> get unevaluatedUnreadConstants {
if (_unreadUnevaluatedVariables.isEmpty) return const [];
+ // Coverage-ignore(suite): Not run.
return _unreadUnevaluatedVariables.map<UnevaluatedConstant>(
(VariableDeclaration variable) =>
_variables[variable]!.value as UnevaluatedConstant);
@@ -5580,6 +5726,7 @@
@override
TreeNode visitFileUriExpression(FileUriExpression node) {
if (node.fileUri == currentFileUri) {
+ // Coverage-ignore-block(suite): Not run.
return node.expression.accept(this);
} else {
Uri? oldFileUri = currentFileUri;
@@ -5898,6 +6045,7 @@
void report(LocatedMessage message, [List<LocatedMessage>? context]);
}
+// Coverage-ignore(suite): Not run.
class SimpleErrorReporter implements ErrorReporter {
const SimpleErrorReporter();
diff --git a/pkg/front_end/lib/src/kernel/constant_int_folder.dart b/pkg/front_end/lib/src/kernel/constant_int_folder.dart
index 43fc143..17393ad 100644
--- a/pkg/front_end/lib/src/kernel/constant_int_folder.dart
+++ b/pkg/front_end/lib/src/kernel/constant_int_folder.dart
@@ -174,6 +174,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int? asInt(Constant constant) {
if (constant is DoubleConstant && _valueIsInteger(constant.value)) {
return constant.value.toInt();
diff --git a/pkg/front_end/lib/src/kernel/constructor_tearoff_lowering.dart b/pkg/front_end/lib/src/kernel/constructor_tearoff_lowering.dart
index 9e0af97..36ab5b3 100644
--- a/pkg/front_end/lib/src/kernel/constructor_tearoff_lowering.dart
+++ b/pkg/front_end/lib/src/kernel/constructor_tearoff_lowering.dart
@@ -91,6 +91,7 @@
declarationConstructor.isFactory) ||
(declarationConstructor is Procedure &&
declarationConstructor.isStatic),
+ // Coverage-ignore(suite): Not run.
"Unexpected constructor tear off target $declarationConstructor "
"(${declarationConstructor.runtimeType}).");
assert(
@@ -99,6 +100,7 @@
declarationConstructor.isFactory) ||
(declarationConstructor is Procedure &&
declarationConstructor.isStatic),
+ // Coverage-ignore(suite): Not run.
"Unexpected constructor tear off target $declarationConstructor "
"(${declarationConstructor.runtimeType}).");
@@ -153,6 +155,7 @@
declarationConstructor.isFactory) ||
(declarationConstructor is Procedure &&
declarationConstructor.isStatic),
+ // Coverage-ignore(suite): Not run.
"Unexpected constructor tear off target $declarationConstructor "
"(${declarationConstructor.runtimeType}).");
assert(
@@ -161,6 +164,7 @@
implementationConstructor.isFactory) ||
(implementationConstructor is Procedure &&
implementationConstructor.isStatic),
+ // Coverage-ignore(suite): Not run.
"Unexpected constructor tear off target $implementationConstructor "
"(${declarationConstructor.runtimeType}).");
@@ -225,6 +229,7 @@
function,
substitution,
libraryBuilder);
+ // Coverage-ignore(suite): Not run.
delayedDefaultValueCloners?.add(delayedDefaultValueCloner);
tearOff.function.fileOffset = tearOff.fileOffset;
tearOff.function.fileEndOffset = tearOff.fileOffset;
@@ -254,7 +259,9 @@
if (!freshTypeParameters.substitution.isEmpty) {
if (typeArguments.length != typeParameters.length) {
// Error case: Use default types as type arguments.
- typeArguments = new List<DartType>.generate(typeParameters.length,
+ typeArguments = new List<DartType>.generate(
+ typeParameters.length,
+ // Coverage-ignore(suite): Not run.
(int index) => typeParameters[index].defaultType);
}
if (typeArguments.isNotEmpty) {
@@ -423,6 +430,7 @@
Expression targetTearOff;
if (target is Constructor ||
target is Procedure && target.isFactory) {
+ // Coverage-ignore-block(suite): Not run.
targetTearOff = new ConstructorTearOff(target!);
} else {
targetTearOff = new StaticTearOff(target as Procedure);
diff --git a/pkg/front_end/lib/src/kernel/exhaustiveness.dart b/pkg/front_end/lib/src/kernel/exhaustiveness.dart
index 7295375..3524704 100644
--- a/pkg/front_end/lib/src/kernel/exhaustiveness.dart
+++ b/pkg/front_end/lib/src/kernel/exhaustiveness.dart
@@ -35,6 +35,7 @@
Map<Node, ExhaustivenessResult> switchResults = {};
}
+// Coverage-ignore(suite): Not run.
class ExhaustivenessResult {
final StaticType scrutineeType;
final List<Space> caseSpaces;
@@ -73,7 +74,9 @@
@override
bool isNullType(DartType type) {
return type is NullType ||
- (type is NeverType && type.nullability == Nullability.nullable);
+ (type is NeverType &&
+ // Coverage-ignore(suite): Not run.
+ type.nullability == Nullability.nullable);
}
@override
@@ -112,6 +115,7 @@
_typeEnvironment.objectNonNullableRawType;
@override
+ // Coverage-ignore(suite): Not run.
DartType get nullableObjectType => _typeEnvironment.objectNullableRawType;
@override
@@ -151,6 +155,7 @@
}
return fieldTypes;
} else if (type is ExtensionType) {
+ // Coverage-ignore-block(suite): Not run.
ExtensionTypeDeclaration extensionTypeDeclaration =
type.extensionTypeDeclaration;
Map<Key, DartType> fieldTypes = {};
@@ -291,11 +296,17 @@
@override
bool hasSimpleName(DartType type) {
return type is InterfaceType ||
+ // Coverage-ignore(suite): Not run.
type is DynamicType ||
+ // Coverage-ignore(suite): Not run.
type is VoidType ||
+ // Coverage-ignore(suite): Not run.
type is NeverType ||
+ // Coverage-ignore(suite): Not run.
type is NullType ||
+ // Coverage-ignore(suite): Not run.
type is ExtensionType ||
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): What about intersection types?
type is TypeParameterType;
}
@@ -435,6 +446,7 @@
// class Class extends _Super&Mixin {}
//
if (superclass.mixedInClass == sealedClass) {
+ // Coverage-ignore-block(suite): Not run.
list.add(cls);
continue outer;
}
@@ -470,6 +482,7 @@
if (thisType.typeArguments.isEmpty) {
return thisType;
}
+ // Coverage-ignore-block(suite): Not run.
bool trivialSubstitution = true;
if (thisType.typeArguments.length == asSealedType.typeArguments.length) {
for (int i = 0; i < thisType.typeArguments.length; i++) {
@@ -649,6 +662,7 @@
hasExplicitTypeArguments:
pattern.keyType != null && pattern.valueType != null);
}
+ // Coverage-ignore-block(suite): Not run.
assert(false, "Unexpected pattern $pattern (${pattern.runtimeType}).");
return createUnknownSpace(path);
}
@@ -666,12 +680,17 @@
return new Space(path, cache.getBoolValueStaticType(constant.value));
} else if (constant is RecordConstant) {
Map<Key, Space> properties = {};
- for (int index = 0; index < constant.positional.length; index++) {
+ for (int index = 0;
+ index < constant.positional.length;
+ // Coverage-ignore(suite): Not run.
+ index++) {
+ // Coverage-ignore-block(suite): Not run.
Key key = new RecordIndexKey(index);
properties[key] = convertConstantToSpace(constant.positional[index],
path: path.add(key));
}
for (MapEntry<String, Constant> entry in constant.named.entries) {
+ // Coverage-ignore-block(suite): Not run.
Key key = new RecordNameKey(entry.key);
properties[key] =
convertConstantToSpace(entry.value, path: path.add(key));
@@ -689,6 +708,7 @@
return new Space(path, cache.getUnknownStaticType());
}
} else {
+ // Coverage-ignore-block(suite): Not run.
// TODO(johnniwinther): Assert that constant value is available when the
// exhaustiveness checking is complete.
return new Space(path, cache.getUnknownStaticType());
@@ -743,11 +763,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitFunctionType(FunctionType type, CoreTypes coreTypes) {
return false;
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitFutureOrType(FutureOrType type, CoreTypes coreTypes) {
return type.typeArgument.accept1(this, coreTypes);
}
@@ -786,11 +808,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitNullType(NullType type, CoreTypes coreTypes) {
return true;
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitRecordType(RecordType type, CoreTypes coreTypes) {
for (DartType positional in type.positional) {
if (!positional.accept1(this, coreTypes)) {
@@ -811,17 +835,20 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitStructuralParameterType(
StructuralParameterType type, CoreTypes coreTypes) {
return type.bound.accept1(this, coreTypes);
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitTypedefType(TypedefType type, CoreTypes coreTypes) {
return type.unalias.accept1(this, coreTypes);
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitVoidType(VoidType type, CoreTypes coreTypes) {
return false;
}
@@ -831,6 +858,7 @@
const TypeParameterReplacer();
@override
+ // Coverage-ignore(suite): Not run.
DartType? visitTypeParameterType(TypeParameterType node, Variance variance) {
DartType replacement = super.visitTypeParameterType(node, variance) ?? node;
if (replacement is TypeParameterType) {
diff --git a/pkg/front_end/lib/src/kernel/expression_generator.dart b/pkg/front_end/lib/src/kernel/expression_generator.dart
index d55352f..bd8b5f2 100644
--- a/pkg/front_end/lib/src/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/kernel/expression_generator.dart
@@ -206,6 +206,7 @@
} else {
if (_helper.constantContext != ConstantContext.none &&
selector.name != lengthName) {
+ // Coverage-ignore-block(suite): Not run.
_helper.addProblem(
messageNotAConstantExpression, fileOffset, token.length);
}
@@ -312,10 +313,13 @@
VariableUseGenerator(
ExpressionGeneratorHelper helper, Token token, this.variable)
- : assert(variable.isAssignable, 'Variable $variable is not assignable'),
+ : assert(
+ variable.isAssignable, // Coverage-ignore(suite): Not run.
+ 'Variable $variable is not assignable'),
super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "VariableUseGenerator";
@override
@@ -399,6 +403,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", variable: ");
@@ -428,6 +433,7 @@
: super(helper, token, variable);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ForInLateFinalVariableUseGenerator";
@override
@@ -474,6 +480,7 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "PropertyAccessGenerator";
@override
@@ -487,6 +494,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", receiver: ");
@@ -564,6 +572,7 @@
static Generator make(ExpressionGeneratorHelper helper, Token token,
Expression receiver, Name name, bool isNullAware) {
if (helper.forest.isThisExpression(receiver)) {
+ // Coverage-ignore-block(suite): Not run.
return new ThisPropertyAccessGenerator(helper, token, name,
thisVariable: null,
thisOffset: receiver.fileOffset,
@@ -624,6 +633,7 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ThisPropertyAccessGenerator";
@override
@@ -707,6 +717,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", name: ");
sink.write(name.text);
@@ -727,9 +738,11 @@
super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "NullAwarePropertyAccessGenerator";
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => name.text;
@override
@@ -796,6 +809,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -810,6 +824,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", receiver: ");
@@ -833,9 +848,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "SuperPropertyAccessGenerator";
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => name.text;
@override
@@ -905,6 +922,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -933,6 +951,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", name: ");
sink.write(name.text);
@@ -956,9 +975,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => "[]";
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "IndexedAccessGenerator";
@override
@@ -1067,6 +1088,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -1082,6 +1104,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", receiver: ");
@@ -1095,6 +1118,7 @@
Expression receiver, Expression index,
{required bool isNullAware}) {
if (helper.forest.isThisExpression(receiver)) {
+ // Coverage-ignore-block(suite): Not run.
return new ThisIndexedAccessGenerator(helper, token, index,
thisOffset: receiver.fileOffset, isNullAware: isNullAware);
} else {
@@ -1118,9 +1142,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => "[]";
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ThisIndexedAccessGenerator";
@override
@@ -1172,6 +1198,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -1180,6 +1207,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -1187,6 +1215,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", index: ");
@@ -1206,9 +1235,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => "[]";
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "SuperIndexedAccessGenerator";
@override
@@ -1304,6 +1335,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -1311,6 +1343,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", index: ");
@@ -1417,6 +1450,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "StaticAccessGenerator";
@override
@@ -1524,6 +1558,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", targetName: ");
sink.write(targetName);
@@ -1624,7 +1659,9 @@
assert(!getterBuilder.isStatic);
readTarget = getterBuilder.readTarget as Procedure?;
invokeTarget = getterBuilder.invokeTarget as Procedure?;
- } else if (getterBuilder.isOperator) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (getterBuilder.isOperator) {
assert(!getterBuilder.isStatic);
invokeTarget = getterBuilder.invokeTarget as Procedure?;
} else {
@@ -1640,6 +1677,7 @@
if (setterBuilder.isSetter) {
assert(!setterBuilder.isStatic);
writeTarget = setterBuilder.writeTarget as Procedure?;
+ // Coverage-ignore-block(suite): Not run.
targetName ??= setterBuilder.name;
} else {
return unhandled(
@@ -1662,6 +1700,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "InstanceExtensionAccessGenerator";
@override
@@ -1798,6 +1837,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -1805,6 +1845,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", targetName: ");
sink.write(targetName);
@@ -1918,6 +1959,7 @@
if (getterBuilder != null) {
assert(!getterBuilder.isStatic);
if (getterBuilder is AccessErrorBuilder) {
+ // Coverage-ignore-block(suite): Not run.
AccessErrorBuilder error = getterBuilder;
getterBuilder = error.builder;
// We should only see an access error here if we've looked up a setter
@@ -1985,6 +2027,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ExplicitExtensionIndexedAccessGenerator";
@override
@@ -2056,6 +2099,7 @@
{required bool forEffect}) {
Expression write;
if (writeTarget == null) {
+ // Coverage-ignore-block(suite): Not run.
write = _makeInvalidWrite(value);
} else {
write = new ExtensionSet(
@@ -2223,6 +2267,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", targetName: ");
sink.write(targetName);
@@ -2296,6 +2341,7 @@
Procedure? readTarget;
if (getterBuilder != null) {
if (getterBuilder is AccessErrorBuilder) {
+ // Coverage-ignore-block(suite): Not run.
AccessErrorBuilder error = getterBuilder;
getterBuilder = error.builder;
// We should only see an access error here if we've looked up a setter
@@ -2336,14 +2382,17 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => "[]";
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ExplicitExtensionIndexedAccessGenerator";
@override
Expression buildSimpleRead() {
if (readTarget == null) {
+ // Coverage-ignore-block(suite): Not run.
return _makeInvalidRead(UnresolvedKind.Method);
}
VariableDeclarationImpl? variable;
@@ -2374,6 +2423,7 @@
@override
Expression buildAssignment(Expression value, {bool voidContext = false}) {
if (writeTarget == null) {
+ // Coverage-ignore-block(suite): Not run.
return _makeInvalidWrite(value);
}
VariableDeclarationImpl? variable;
@@ -2485,6 +2535,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -2500,6 +2551,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", index: ");
@@ -2548,12 +2600,14 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead {
return unsupported(
"ExplicitExtensionAccessGenerator.plainNameForRead", fileOffset, _uri);
}
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ExplicitExtensionAccessGenerator";
@override
@@ -2562,11 +2616,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildAssignment(Expression value, {bool voidContext = false}) {
return _makeInvalidWrite(value);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return _makeInvalidRead();
@@ -2624,6 +2680,7 @@
Selector selector, int operatorOffset, bool isNullAware) {
selector.reportNewAsSelector();
if (_helper.constantContext != ConstantContext.none) {
+ // Coverage-ignore-block(suite): Not run.
_helper.addProblem(
messageNotAConstantExpression, fileOffset, token.length);
}
@@ -2671,6 +2728,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression _makeInvalidWrite(Expression value) {
return _helper.buildProblem(
messageExplicitExtensionAsLvalue, fileOffset, lengthForToken(token));
@@ -2682,6 +2740,7 @@
Builder? getter = extensionBuilder.lookupLocalMemberByName(indexGetName);
Builder? setter = extensionBuilder.lookupLocalMemberByName(indexSetName);
if (getter == null && setter == null) {
+ // Coverage-ignore-block(suite): Not run.
return new UnresolvedNameGenerator(_helper, token, indexGetName,
unresolvedReadKind: UnresolvedKind.Method);
}
@@ -2704,6 +2763,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", extensionBuilder: ");
sink.write(extensionBuilder);
@@ -2720,9 +2780,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => 'loadLibrary';
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "LoadLibraryGenerator";
@override
@@ -2735,11 +2797,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildAssignment(Expression value, {bool voidContext = false}) {
return _makeInvalidWrite(value);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
Expression read = buildSimpleRead();
@@ -2749,6 +2813,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = TreeNode.noOffset,
bool voidContext = false,
@@ -2760,6 +2825,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
Expression value = _forest.createIntLiteral(offset, 1);
@@ -2773,6 +2839,7 @@
{bool isTypeArgumentsInForest = false}) {
if (_forest.argumentsPositional(arguments).length > 0 ||
_forest.argumentsNamed(arguments).length > 0) {
+ // Coverage-ignore-block(suite): Not run.
_helper.addProblemErrorIfConst(
messageLoadLibraryTakesNoArguments, offset, 'loadLibrary'.length);
}
@@ -2780,6 +2847,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -2787,6 +2855,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", builder: ");
sink.write(builder);
@@ -2817,6 +2886,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return _helper.wrapInDeferredCheck(
@@ -2827,6 +2897,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = TreeNode.noOffset,
bool voidContext = false,
@@ -2843,6 +2914,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return _helper.wrapInDeferredCheck(
@@ -2869,11 +2941,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead {
return unsupported("deferredAccessor.plainNameForRead", fileOffset, _uri);
}
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "DeferredAccessGenerator";
@override
@@ -2890,6 +2964,7 @@
LocatedMessage message;
if (type is NamedTypeBuilder &&
type.declaration is InvalidTypeDeclarationBuilder) {
+ // Coverage-ignore-block(suite): Not run.
InvalidTypeDeclarationBuilder declaration =
type.declaration as InvalidTypeDeclarationBuilder;
message = declaration.message;
@@ -2943,6 +3018,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -2950,6 +3026,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", prefixGenerator: ");
sink.write(prefixGenerator);
@@ -3000,6 +3077,7 @@
String get targetName => typeName.name;
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "TypeUseGenerator";
@override
@@ -3008,6 +3086,7 @@
{required bool allowPotentiallyConstantType,
required bool performTypeCanonicalization}) {
if (declaration is OmittedTypeDeclarationBuilder) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(johnniwinther): Report errors when this occurs in-body or with
// type arguments.
// TODO(johnniwinther): Handle nullability.
@@ -3044,6 +3123,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", declaration: ");
sink.write(declaration);
@@ -3099,11 +3179,17 @@
ClassBuilder() => true,
ExtensionBuilder() => false,
ExtensionTypeDeclarationBuilder() => true,
+ // Coverage-ignore(suite): Not run.
TypeAliasBuilder() => false,
+ // Coverage-ignore(suite): Not run.
NominalVariableBuilder() => false,
+ // Coverage-ignore(suite): Not run.
StructuralVariableBuilder() => false,
+ // Coverage-ignore(suite): Not run.
InvalidTypeDeclarationBuilder() => false,
+ // Coverage-ignore(suite): Not run.
BuiltinTypeDeclarationBuilder() => false,
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
OmittedTypeDeclarationBuilder() => false,
null => false,
@@ -3116,6 +3202,7 @@
.toList();
if (aliasedTypeArguments != null &&
aliasedTypeArguments.length != aliasBuilder.typeVariablesCount) {
+ // Coverage-ignore-block(suite): Not run.
_helper.libraryBuilder.addProblem(
templateTypeArgumentMismatch
.withArguments(aliasBuilder.typeVariablesCount),
@@ -3176,6 +3263,7 @@
if (send is PropertySelector) {
assert(
send.typeArguments == null,
+ // Coverage-ignore(suite): Not run.
"Unexpected non-null typeArguments of "
"an IncompletePropertyAccessGenerator object: "
"'${send.typeArguments.runtimeType}'.");
@@ -3232,11 +3320,13 @@
in declarationBuilder.cls.typeParameters) {
builtTypeArguments.add(typeParameter.defaultType);
}
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeDeclarationBuilder():
for (TypeParameter typeParameter in declarationBuilder
.extensionTypeDeclaration.typeParameters) {
builtTypeArguments.add(typeParameter.defaultType);
}
+ // Coverage-ignore(suite): Not run.
case ExtensionBuilder():
throw new UnsupportedError(
"Unexpected declaration $declarationBuilder");
@@ -3266,6 +3356,7 @@
name.text, nameOffset, _uri, _helper.libraryBuilder);
if (tearOffLowering != null) {
if (tearOffLowering.isFactory) {
+ // Coverage-ignore-block(suite): Not run.
return _helper.forest.createConstructorTearOff(
token.charOffset, tearOffLowering);
} else {
@@ -3367,6 +3458,7 @@
offsetForToken(send.token), send.typeArguments, arguments,
isTypeArgumentsInForest: send.isTypeArgumentsInForest);
} else {
+ // Coverage-ignore-block(suite): Not run.
// `SomeType?.toString` is the same as `SomeType.toString`, not
// `(SomeType).toString`.
return super.buildSelectorAccess(send, operatorOffset, isNullAware);
@@ -3479,6 +3571,7 @@
Expression get expression;
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ReadOnlyAccessGenerator";
@override
@@ -3571,6 +3664,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
NameSystem syntheticNames = new NameSystem();
sink.write(", expression: ");
@@ -3592,6 +3686,7 @@
required UnresolvedKind kind,
int? charOffset});
+ // Coverage-ignore(suite): Not run.
Name get name => unsupported("name", fileOffset, _uri);
@override
@@ -3605,6 +3700,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression_Generator_Initializer doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -3620,11 +3716,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildAssignment(Expression value, {bool voidContext = false}) {
return buildError(rhs: value, kind: UnresolvedKind.Setter);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = -1,
bool voidContext = false,
@@ -3654,22 +3752,26 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return buildError(rhs: value, kind: UnresolvedKind.Setter);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildSimpleRead() {
return buildError(kind: UnresolvedKind.Member);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression _makeInvalidRead(UnresolvedKind unresolvedKind) {
return buildError(kind: unresolvedKind);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression _makeInvalidWrite(Expression value) {
return buildError(rhs: value, kind: UnresolvedKind.Setter);
}
@@ -3695,6 +3797,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -3723,6 +3826,7 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "UnresolvedNameGenerator";
@override
@@ -3771,6 +3875,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", name: ");
sink.write(name.text);
@@ -3797,11 +3902,13 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead {
return unsupported("plainNameForRead", token.charOffset, _helper.uri);
}
@override
+ // Coverage-ignore(suite): Not run.
Never doInvocation(
int charOffset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -3809,17 +3916,20 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildAssignment(Expression value, {bool voidContext = false}) {
return _makeInvalidWrite(value);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return _makeInvalidWrite(value);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = -1,
bool voidContext = false,
@@ -3829,29 +3939,34 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPrefixIncrement(Name binaryOperator,
{int offset = -1, bool voidContext = false}) {
return _makeInvalidWrite(null);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = -1, bool voidContext = false}) {
return _makeInvalidWrite(null);
}
@override
+ // Coverage-ignore(suite): Not run.
Never _makeInvalidRead([UnresolvedKind? unresolvedKind]) {
return unsupported("makeInvalidRead", token.charOffset, _helper.uri);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression _makeInvalidWrite(Expression? value) {
return _helper.buildProblem(messageIllegalAssignmentToNonAssignable,
fileOffset, lengthForToken(token));
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -3869,6 +3984,7 @@
: super(helper, token, generator);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "DelayedAssignment";
@override
@@ -3898,18 +4014,22 @@
return generator.buildCompoundAssignment(multiplyName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical("%=", assignmentOperator)) {
+ // Coverage-ignore-block(suite): Not run.
return generator.buildCompoundAssignment(percentName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical("&=", assignmentOperator)) {
return generator.buildCompoundAssignment(ampersandName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical("/=", assignmentOperator)) {
+ // Coverage-ignore-block(suite): Not run.
return generator.buildCompoundAssignment(divisionName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical("<<=", assignmentOperator)) {
+ // Coverage-ignore-block(suite): Not run.
return generator.buildCompoundAssignment(leftShiftName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical(">>=", assignmentOperator)) {
+ // Coverage-ignore-block(suite): Not run.
return generator.buildCompoundAssignment(rightShiftName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical(">>>=", assignmentOperator)) {
@@ -3919,7 +4039,9 @@
return generator.buildIfNullAssignment(
value, const DynamicType(), fileOffset,
voidContext: voidContext);
- } else if (identical("^=", assignmentOperator)) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (identical("^=", assignmentOperator)) {
return generator.buildCompoundAssignment(caretName, value,
offset: fileOffset, voidContext: voidContext);
} else if (identical("|=", assignmentOperator)) {
@@ -3945,6 +4067,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", value: ");
printNodeOn(value, sink);
@@ -3961,6 +4084,7 @@
: super(helper, token, generator);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "DelayedPostfixIncrement";
@override
@@ -3976,6 +4100,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", binaryOperator: ");
sink.write(binaryOperator.text);
@@ -3992,6 +4117,7 @@
String get _plainNameForRead => prefix.name;
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "PrefixUseGenerator";
@override
@@ -4003,12 +4129,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return _makeInvalidRead();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = TreeNode.noOffset,
bool voidContext = false,
@@ -4018,6 +4146,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return _makeInvalidRead();
@@ -4026,6 +4155,7 @@
@override
/* Expression | Generator */ Object qualifiedLookup(Token nameToken) {
if (_helper.constantContext != ConstantContext.none && prefix.deferred) {
+ // Coverage-ignore-block(suite): Not run.
_helper.addProblem(
templateCantUseDeferredPrefixAsConstant.withArguments(token),
fileOffset,
@@ -4040,6 +4170,7 @@
new DeferredAccessGenerator(_helper, nameToken, this, result);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
_helper.wrapInDeferredCheck(result as Expression, prefix, fileOffset);
}
}
@@ -4060,7 +4191,9 @@
@override
Expression_Generator buildSelectorAccess(
Selector selector, int operatorOffset, bool isNullAware) {
- assert(selector.name.text == selector.token.lexeme,
+ assert(
+ selector.name.text == selector.token.lexeme,
+ // Coverage-ignore(suite): Not run.
"'${selector.name.text}' != ${selector.token.lexeme}");
selector.reportNewAsSelector();
Object result = qualifiedLookup(selector.token);
@@ -4088,6 +4221,7 @@
Expression _makeInvalidWrite(Expression value) => _makeInvalidRead();
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -4095,6 +4229,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", prefix: ");
sink.write(prefix.name);
@@ -4117,23 +4252,28 @@
"${prefixGenerator._plainNameForRead}.${token.lexeme}";
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "UnexpectedQualifiedUseGenerator";
@override
+ // Coverage-ignore(suite): Not run.
Expression buildSimpleRead() => _makeInvalidRead(UnresolvedKind.Member);
@override
+ // Coverage-ignore(suite): Not run.
Expression buildAssignment(Expression value, {bool voidContext = false}) {
return _makeInvalidWrite(value);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return _makeInvalidRead(UnresolvedKind.Member);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = TreeNode.noOffset,
bool voidContext = false,
@@ -4143,12 +4283,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return _makeInvalidRead(UnresolvedKind.Member);
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -4180,6 +4322,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -4187,6 +4330,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", prefixGenerator: ");
prefixGenerator.printOn(sink);
@@ -4201,12 +4345,15 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => "#parser-error";
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ParserErrorGenerator";
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {}
Expression buildProblem() {
@@ -4223,12 +4370,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return buildProblem();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = TreeNode.noOffset,
bool voidContext = false,
@@ -4238,22 +4387,26 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPrefixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return buildProblem();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return buildProblem();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression _makeInvalidRead([UnresolvedKind? unresolvedKind]) =>
buildProblem();
@override
+ // Coverage-ignore(suite): Not run.
Expression _makeInvalidWrite(Expression value) => buildProblem();
@override
@@ -4262,6 +4415,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression doInvocation(
int offset, List<TypeBuilder>? typeArguments, Arguments arguments,
{bool isTypeArgumentsInForest = false}) {
@@ -4269,6 +4423,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildSelectorAccess(
Selector send, int operatorOffset, bool isNullAware) {
return buildProblem();
@@ -4296,6 +4451,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression invokeConstructor(
List<TypeBuilder>? typeArguments,
String name,
@@ -4308,6 +4464,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Generator buildIndexedAccess(Expression index, Token token,
{required bool isNullAware}) {
return new IndexedAccessGenerator(_helper, token, buildSimpleRead(), index,
@@ -4381,12 +4538,14 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead {
return unsupported(
"${isSuper ? 'super' : 'this'}.plainNameForRead", fileOffset, _uri);
}
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ThisAccessGenerator";
@override
@@ -4500,6 +4659,7 @@
}
return result;
}
+ // Coverage-ignore(suite): Not run.
return super.buildEqualsOperation(token, right, isNot: isNot);
}
@@ -4511,6 +4671,7 @@
return _helper.buildSuperInvocation(binaryName,
_forest.createArguments(offset, <Expression>[right]), offset);
}
+ // Coverage-ignore(suite): Not run.
return super.buildBinaryOperation(token, binaryName, right);
}
@@ -4521,6 +4682,7 @@
return _helper.buildSuperInvocation(
unaryName, _forest.createArgumentsEmpty(offset), offset);
}
+ // Coverage-ignore(suite): Not run.
return super.buildUnaryOperation(token, unaryName);
}
@@ -4552,17 +4714,20 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildAssignment(Expression value, {bool voidContext = false}) {
return buildAssignmentError();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
return buildAssignmentError();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset = TreeNode.noOffset,
bool voidContext = false,
@@ -4572,12 +4737,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPrefixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return buildAssignmentError();
}
@override
+ // Coverage-ignore(suite): Not run.
Expression buildPostfixIncrement(Name binaryOperator,
{int offset = TreeNode.noOffset, bool voidContext = false}) {
return buildAssignmentError();
@@ -4599,6 +4766,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
Expression buildAssignmentError() {
return _helper.buildProblem(
isSuper ? messageCannotAssignToSuper : messageNotAnLvalue,
@@ -4607,6 +4775,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", isInitializer: ");
sink.write(isInitializer);
@@ -4627,9 +4796,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead => token.lexeme;
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "IncompleteErrorGenerator";
@override
@@ -4660,6 +4831,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", message: ");
sink.write(message.code.name);
@@ -4700,6 +4872,7 @@
_helper.forest.createParenthesized(expression.fileOffset, expression);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "ParenthesizedExpressionGenerator";
@override
@@ -4713,7 +4886,9 @@
isConstantExpression: selector.isPotentiallyConstant);
} else {
if (_helper.constantContext != ConstantContext.none &&
+ // Coverage-ignore(suite): Not run.
selector.name != lengthName) {
+ // Coverage-ignore-block(suite): Not run.
_helper.addProblem(
messageNotAConstantExpression, fileOffset, token.length);
}
@@ -4767,6 +4942,7 @@
List<TypeBuilder>? get typeArguments => null;
+ // Coverage-ignore(suite): Not run.
bool get isTypeArgumentsInForest => true;
Arguments? get arguments => null;
@@ -4827,6 +5003,7 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => 'InvocationSelector';
@override
@@ -4842,6 +5019,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", name: ");
sink.write(name.text);
@@ -4870,6 +5048,7 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => 'PropertySelector';
@override
@@ -4884,6 +5063,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", name: ");
sink.write(name.text);
@@ -4898,9 +5078,11 @@
: super(helper, token);
@override
+ // Coverage-ignore(suite): Not run.
String get _debugName => "AugmentSuperGenerator";
@override
+ // Coverage-ignore(suite): Not run.
String get _plainNameForRead {
return unsupported("augment super.plainNameForRead", fileOffset, _uri);
}
@@ -4982,6 +5164,7 @@
return buildCompoundAssignment(binaryOperator, value,
offset: offset, voidContext: voidContext, isPostIncDec: true);
}
+ // Coverage-ignore-block(suite): Not run.
VariableDeclarationImpl read =
_helper.createVariableDeclarationForValue(_createRead());
Expression binary = _helper.forest.createBinary(offset,
@@ -5011,6 +5194,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void printOn(StringSink sink) {
sink.write(", augmentSuperTarget: ");
sink.write(augmentSuperTarget);
diff --git a/pkg/front_end/lib/src/kernel/forest.dart b/pkg/front_end/lib/src/kernel/forest.dart
index 8725f26..6853223 100644
--- a/pkg/front_end/lib/src/kernel/forest.dart
+++ b/pkg/front_end/lib/src/kernel/forest.dart
@@ -446,7 +446,12 @@
Expression? condition,
List<Expression> updaters,
Statement body) {
- return new ForStatement(variables ?? [], condition, updaters, body)
+ return new ForStatement(
+ variables ?? // Coverage-ignore(suite): Not run.
+ [],
+ condition,
+ updaters,
+ body)
..fileOffset = fileOffset;
}
@@ -582,14 +587,17 @@
bool isErroneousNode(Object? node) {
if (node is ExpressionStatement) {
+ // Coverage-ignore-block(suite): Not run.
ExpressionStatement statement = node;
node = statement.expression;
}
if (node is VariableDeclaration) {
+ // Coverage-ignore-block(suite): Not run.
VariableDeclaration variable = node;
node = variable.initializer;
}
if (node is Let) {
+ // Coverage-ignore-block(suite): Not run.
Let let = node;
node = let.variable.initializer;
}
@@ -713,15 +721,21 @@
}
ConstructorTearOff createConstructorTearOff(int fileOffset, Member target) {
- assert(target is Constructor || (target is Procedure && target.isFactory),
+ assert(
+ target is Constructor || (target is Procedure && target.isFactory),
+ // Coverage-ignore(suite): Not run.
"Unexpected constructor tear off target: $target");
return new ConstructorTearOff(target)..fileOffset = fileOffset;
}
StaticTearOff createStaticTearOff(int fileOffset, Procedure procedure) {
- assert(procedure.kind == ProcedureKind.Method,
+ assert(
+ procedure.kind == ProcedureKind.Method,
+ // Coverage-ignore(suite): Not run.
"Unexpected static tear off target: $procedure");
- assert(!procedure.isRedirectingFactory,
+ assert(
+ !procedure.isRedirectingFactory,
+ // Coverage-ignore(suite): Not run.
"Unexpected static tear off target: $procedure");
return new StaticTearOff(procedure)..fileOffset = fileOffset;
}
@@ -902,26 +916,31 @@
}
@override
+ // Coverage-ignore(suite): Not run.
R accept<R>(v) {
throw unsupported("accept", fileOffset, uri);
}
@override
+ // Coverage-ignore(suite): Not run.
R accept1<R, A>(v, arg) {
throw unsupported("accept1", fileOffset, uri);
}
@override
+ // Coverage-ignore(suite): Not run.
Never visitChildren(v) {
throw unsupported("visitChildren", fileOffset, uri);
}
@override
+ // Coverage-ignore(suite): Not run.
Never transformChildren(v) {
throw unsupported("transformChildren", fileOffset, uri);
}
@override
+ // Coverage-ignore(suite): Not run.
Never transformOrRemoveChildren(v) {
throw unsupported("transformOrRemoveChildren", fileOffset, uri);
}
@@ -932,6 +951,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
for (int index = 0; index < declarations.length; index++) {
if (index > 0) {
diff --git a/pkg/front_end/lib/src/kernel/forwarding_node.dart b/pkg/front_end/lib/src/kernel/forwarding_node.dart
index 269bb4b..7ebfc3b 100644
--- a/pkg/front_end/lib/src/kernel/forwarding_node.dart
+++ b/pkg/front_end/lib/src/kernel/forwarding_node.dart
@@ -97,6 +97,7 @@
if (_combinedMemberSignature.members.length == 1 &&
!needMixinStub &&
!hasNoSuchMethodTarget) {
+ // Coverage-ignore-block(suite): Not run.
// Optimization: Avoid complex computation for simple scenarios.
// Covariance can only come from [interfaceMember] so we never need a
@@ -214,6 +215,7 @@
case ProcedureStubKind.ConcreteMixinStub:
finalTarget = interfaceMember.stubTarget!;
break;
+ // Coverage-ignore(suite): Not run.
case ProcedureStubKind.RepresentationField:
assert(
false,
@@ -248,11 +250,14 @@
return stub;
} else {
if (_combinedMemberSignature.needsCovarianceMerging) {
+ // Coverage-ignore-block(suite): Not run.
_combinedMemberSignature.combinedMemberSignatureCovariance!
.applyCovariance(interfaceMember);
}
if (needsNoSuchMethodForwarder) {
- assert(interfaceMember is Procedure,
+ assert(
+ interfaceMember is Procedure,
+ // Coverage-ignore(suite): Not run.
"Unexpected abstract member: ${interfaceMember}");
(interfaceMember as Procedure).stubKind =
ProcedureStubKind.NoSuchMethodForwarder;
@@ -297,6 +302,7 @@
Expression superCall;
assert(
!superTarget.isAbstract,
+ // Coverage-ignore(suite): Not run.
"Abstract super target $superTarget found for '${name}' in "
"${typeDeclaration}.");
switch (kind) {
@@ -398,6 +404,7 @@
}
superCall = new SuperPropertySet(name, expression, superTarget);
break;
+ // Coverage-ignore(suite): Not run.
default:
unhandled('$kind', '_createForwardingImplIfNeeded', -1, null);
}
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/class_member.dart b/pkg/front_end/lib/src/kernel/hierarchy/class_member.dart
index e2616cf..30c0576 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/class_member.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/class_member.dart
@@ -64,6 +64,7 @@
{required this.isDeclaredAsField})
: assert(
member.enclosingTypeDeclaration != null,
+ // Coverage-ignore(suite): Not run.
"Type declaration member without enclosing type "
"declaration $member.");
@@ -89,7 +90,8 @@
DartType getMemberType(
ClassMembersBuilder membersBuilder, TypeDeclarationType thisType) {
DartType type = switch (kind) {
- ClassMemberKind.Method => member.getterType,
+ ClassMemberKind.Method => // Coverage-ignore(suite): Not run.
+ member.getterType,
ClassMemberKind.Getter => member.getterType,
ClassMemberKind.Setter => member.setterType,
};
@@ -132,7 +134,8 @@
DartType getMemberType(
ClassMembersBuilder membersBuilder, TypeDeclarationType thisType) {
return switch (kind) {
- ClassMemberKind.Method => member.getterType,
+ ClassMemberKind.Method => // Coverage-ignore(suite): Not run.
+ member.getterType,
ClassMemberKind.Getter => member.getterType,
ClassMemberKind.Setter => member.setterType,
};
@@ -172,6 +175,7 @@
ClassMembersBuilder membersBuilder, TypeDeclarationType thisType) {
FunctionType type = member.getterType as FunctionType;
if (type.typeParameters.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
type = FunctionTypeInstantiator.instantiate(
type,
membersBuilder.hierarchyBuilder.types.getTypeArgumentsAsInstanceOf(
@@ -179,6 +183,7 @@
}
switch (kind) {
case ClassMemberKind.Method:
+ // Coverage-ignore(suite): Not run.
// For methods [member] is the tear-off so the member type is the return
// type.
return type.returnType;
@@ -349,18 +354,22 @@
bool get isProperty => memberKind != ClassMemberKind.Method;
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get declarations => throw new UnimplementedError();
@override
+ // Coverage-ignore(suite): Not run.
void inferType(ClassMembersBuilder membersBuilder) {}
@override
bool get isDuplicate => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isField => throw new UnimplementedError();
@override
+ // Coverage-ignore(suite): Not run.
bool get isGetter => throw new UnimplementedError();
@override
@@ -376,9 +385,11 @@
bool get isStatic => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isSynthesized => true;
@override
+ // Coverage-ignore(suite): Not run.
void registerOverrideDependency(Set<ClassMember> overriddenMembers) {}
@override
@@ -389,9 +400,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool get isExtensionTypeMember => false;
@override
+ // Coverage-ignore(suite): Not run.
Member? getTearOff(ClassMembersBuilder membersBuilder) {
// Ensure member is computed.
getMember(membersBuilder);
@@ -623,6 +636,7 @@
assert(
_covariance ==
new Covariance.fromMember(_member!, forSetter: forSetter),
+ // Coverage-ignore(suite): Not run.
"Unexpected covariance for combined members signature "
"$_member. Found $_covariance, expected "
"${new Covariance.fromMember(_member!, forSetter: forSetter)}.");
@@ -651,6 +665,7 @@
ClassMember get interfaceMember => this;
@override
+ // Coverage-ignore(suite): Not run.
bool isObjectMember(ClassBuilder objectClass) {
return false;
}
@@ -679,6 +694,7 @@
declarations.map((ClassMember m) => m.fullName).join("%");
@override
+ // Coverage-ignore(suite): Not run.
String get fullName {
String suffix = isSetter ? "=" : "";
return "${fullNameForErrors}$suffix";
@@ -803,11 +819,13 @@
ClassMember get interfaceMember => implementedInterfaceMember;
@override
+ // Coverage-ignore(suite): Not run.
bool isObjectMember(ClassBuilder objectClass) {
return inheritedClassMember.isObjectMember(objectClass);
}
@override
+ // Coverage-ignore(suite): Not run.
bool isSameDeclaration(ClassMember other) {
// TODO(johnniwinther): Optimize this.
return false;
@@ -846,6 +864,7 @@
assert(
!(implementedInterfaceMember.isNoSuchMethodForwarder &&
!inheritedClassMember.isNoSuchMethodForwarder),
+ // Coverage-ignore(suite): Not run.
"The inherited $inheritedClassMember has "
"isNoSuchMethodForwarder="
"${inheritedClassMember.isNoSuchMethodForwarder} but "
@@ -871,6 +890,7 @@
String get fullNameForErrors => inheritedClassMember.fullNameForErrors;
@override
+ // Coverage-ignore(suite): Not run.
String get fullName => inheritedClassMember.fullName;
@override
@@ -908,6 +928,7 @@
DeclarationBuilder get declarationBuilder => extensionTypeDeclarationBuilder;
@override
+ // Coverage-ignore(suite): Not run.
bool get hasDeclarations => true;
void _ensureMemberAndCovariance(ClassMembersBuilder membersBuilder) {
@@ -983,6 +1004,7 @@
assert(
_covariance ==
new Covariance.fromMember(_member!, forSetter: forSetter),
+ // Coverage-ignore(suite): Not run.
"Unexpected covariance for combined members signature "
"$_member. Found $_covariance, expected "
"${new Covariance.fromMember(_member!, forSetter: forSetter)}.");
@@ -1008,36 +1030,45 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ClassMember get interfaceMember => this;
@override
+ // Coverage-ignore(suite): Not run.
bool isObjectMember(ClassBuilder objectClass) {
return false;
}
@override
+ // Coverage-ignore(suite): Not run.
bool isSameDeclaration(ClassMember other) {
// TODO(johnniwinther): Optimize this.
return false;
}
@override
+ // Coverage-ignore(suite): Not run.
bool get isNoSuchMethodForwarder => false;
@override
+ // Coverage-ignore(suite): Not run.
int get charOffset => declarations.first.charOffset;
@override
+ // Coverage-ignore(suite): Not run.
Uri get fileUri => declarations.first.fileUri;
@override
+ // Coverage-ignore(suite): Not run.
bool get isAbstract => true;
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors =>
declarations.map((ClassMember m) => m.fullName).join("%");
@override
+ // Coverage-ignore(suite): Not run.
String get fullName {
String suffix = isSetter ? "=" : "";
return "${fullNameForErrors}$suffix";
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart b/pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart
index 38aa5aa..9dc256c 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/extension_type_members.dart
@@ -45,6 +45,7 @@
memberMap[name] =
new _Tuple.declareExtensionTypeGetable(classMember);
} else {
+ // Coverage-ignore-block(suite): Not run.
tuple.declaredExtensionTypeGetable = classMember;
}
} else {
@@ -52,6 +53,7 @@
memberMap[name] =
new _Tuple.declareNonExtensionTypeGetable(classMember);
} else {
+ // Coverage-ignore-block(suite): Not run.
tuple.declaredNonExtensionTypeGetable = classMember;
}
}
@@ -67,6 +69,7 @@
tuple.declaredExtensionTypeSetable = classMember;
}
} else {
+ // Coverage-ignore-block(suite): Not run.
if (tuple == null) {
memberMap[name] =
new _Tuple.declareNonExtensionTypeSetable(classMember);
@@ -314,6 +317,7 @@
this._declaredExtensionTypeSetable = declaredSetable,
this.name = declaredSetable.name;
+ // Coverage-ignore(suite): Not run.
_Tuple.declareNonExtensionTypeSetable(ClassMember declaredSetable)
: assert(declaredSetable.forSetter),
this._declaredNonExtensionTypeSetable = declaredSetable,
@@ -334,6 +338,7 @@
ClassMember? get declaredExtensionTypeGetable =>
_declaredExtensionTypeGetable;
+ // Coverage-ignore(suite): Not run.
void set declaredExtensionTypeGetable(ClassMember? value) {
assert(!value!.forSetter);
assert(
@@ -355,10 +360,12 @@
assert(value!.forSetter);
assert(
_declaredExtensionTypeSetable == null,
+ // Coverage-ignore(suite): Not run.
"Declared extension type setable already set to "
"$_declaredExtensionTypeSetable, trying to set it to $value.");
assert(
_declaredNonExtensionTypeSetable == null,
+ // Coverage-ignore(suite): Not run.
"Declared non-extension type setable already set to "
"$_declaredNonExtensionTypeSetable, trying to set the declared "
"extension type setable to $value.");
@@ -368,6 +375,7 @@
ClassMember? get declaredNonExtensionTypeGetable =>
_declaredNonExtensionTypeGetable;
+ // Coverage-ignore(suite): Not run.
void set declaredNonExtensionTypeGetable(ClassMember? value) {
assert(!value!.forSetter);
assert(
@@ -385,6 +393,7 @@
ClassMember? get declaredNonExtensionTypeSetable =>
_declaredNonExtensionTypeSetable;
+ // Coverage-ignore(suite): Not run.
void set declaredNonExtensionTypeSetable(ClassMember? value) {
assert(value!.forSetter);
assert(
@@ -596,6 +605,7 @@
/// implements Interface {}
definingGetable = implementedGetable;
} else if (definingGetable.isStatic) {
+ // Coverage-ignore-block(suite): Not run.
/// class Interface {
/// method() {}
/// }
@@ -613,7 +623,9 @@
// On the first skipped member we add all previous.
implementedNonExtensionTypeGetables ??=
tupleImplementedNonExtensionTypeGetables.take(i).toList();
- } else if (implementedNonExtensionTypeGetables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (implementedNonExtensionTypeGetables != null) {
// If already skipping members we add [implementedGetable]
// explicitly.
implementedNonExtensionTypeGetables.add(implementedGetable);
@@ -666,6 +678,7 @@
/// class Class implements Interface {}
definingSetable = implementedSetable;
} else if (definingSetable.isStatic) {
+ // Coverage-ignore-block(suite): Not run.
/// class Interface {
/// set setter(value) {}
/// }
@@ -679,6 +692,7 @@
implementedSetable = null;
}
}
+ // Coverage-ignore(suite): Not run.
if (implementedSetable == null) {
// On the first skipped setter we add all previous.
implementedNonExtensionTypeSetables ??=
@@ -693,7 +707,9 @@
// No setters were skipped so we use the full list.
implementedNonExtensionTypeSetables =
tupleImplementedNonExtensionTypeSetables;
- } else if (implementedNonExtensionTypeSetables.isEmpty) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (implementedNonExtensionTypeSetables.isEmpty) {
// No setters were included.
implementedNonExtensionTypeSetables = null;
}
@@ -751,7 +767,9 @@
// On the first skipped member we add all previous.
implementedExtensionTypeGetables ??=
tupleImplementedExtensionTypeGetables.take(i).toList();
- } else if (implementedExtensionTypeGetables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (implementedExtensionTypeGetables != null) {
// If already skipping members we add [implementedGetable]
// explicitly.
implementedExtensionTypeGetables.add(implementedGetable);
@@ -802,6 +820,7 @@
/// class Class implements Interface {}
definingSetable = implementedSetable;
} else if (definingSetable.isStatic) {
+ // Coverage-ignore-block(suite): Not run.
/// class Interface {
/// set setter(value) {}
/// }
@@ -818,7 +837,9 @@
// On the first skipped setter we add all previous.
implementedExtensionTypeSetables ??=
tupleImplementedExtensionTypeSetables.take(i).toList();
- } else if (implementedExtensionTypeSetables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (implementedExtensionTypeSetables != null) {
// If already skipping setters we add [implementedSetable]
// explicitly.
implementedExtensionTypeSetables.add(implementedSetable);
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_builder.dart b/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_builder.dart
index cd6746c..3031557 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_builder.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_builder.dart
@@ -79,6 +79,7 @@
Supertype? asSupertypeOf(InterfaceType subtype, Class supertype) {
if (subtype.classNode == supertype) {
+ // Coverage-ignore-block(suite): Not run.
return new Supertype(supertype, subtype.typeArguments);
}
Supertype? cls = getClassAsInstanceOf(subtype.classNode, supertype);
@@ -128,10 +129,12 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool isSubInterfaceOf(Class subtype, Class superclass) {
return getClassAsInstanceOf(subtype, superclass) != null;
}
+ // Coverage-ignore(suite): Not run.
InterfaceType _getLegacyLeastUpperBoundInternal(
TypeDeclarationType type1,
TypeDeclarationType type2,
@@ -192,6 +195,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
InterfaceType getLegacyLeastUpperBound(
InterfaceType type1, InterfaceType type2) {
if (type1 == type2) return type1;
@@ -201,6 +205,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
InterfaceType getLegacyLeastUpperBoundFromSupertypeLists(
TypeDeclarationType type1,
TypeDeclarationType type2,
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart b/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart
index bf4fb2c..4187ccd 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/hierarchy_node.dart
@@ -90,6 +90,7 @@
if (interfaces.length == 1) {
return null;
} else {
+ // Coverage-ignore-block(suite): Not run.
interfaces = interfaces.toList();
interfaces.removeAt(i);
return _ignoreFunction(interfaces);
@@ -319,6 +320,7 @@
/// If `true`, [mixedInNode] is non-null.
bool get isMixinApplication => mixedInNode != null;
+ // Coverage-ignore(suite): Not run.
/// Returns a list of all supertypes of [classBuilder], including this node.
List<ClassHierarchyNode> computeAllSuperNodes(
ClassHierarchyBuilder hierarchy) {
@@ -369,6 +371,7 @@
return "$sb";
}
+ // Coverage-ignore(suite): Not run.
static int compareMaxInheritancePath(
ClassHierarchyNode a, ClassHierarchyNode b) {
return b.maxInheritancePath.compareTo(a.maxInheritancePath);
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/members_builder.dart b/pkg/front_end/lib/src/kernel/hierarchy/members_builder.dart
index 0fc144c..2879650 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/members_builder.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/members_builder.dart
@@ -181,7 +181,9 @@
ClassMembersBuilder membersBuilder =
new ClassMembersBuilder(hierarchyBuilder);
for (ClassBuilder classBuilder in classes) {
- assert(!classBuilder.isAugmenting,
+ assert(
+ !classBuilder.isAugmenting,
+ // Coverage-ignore(suite): Not run.
"Unexpected augmentation class $classBuilder");
membersBuilder.classNodes[classBuilder.cls] = new ClassMembersNodeBuilder(
membersBuilder,
@@ -192,6 +194,7 @@
in extensionTypeDeclarations) {
assert(
!extensionTypeDeclarationBuilder.isAugmenting,
+ // Coverage-ignore(suite): Not run.
"Unexpected augment extension type declaration "
"$extensionTypeDeclarationBuilder");
membersBuilder.extensionTypeDeclarationNodes[
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/members_node.dart b/pkg/front_end/lib/src/kernel/hierarchy/members_node.dart
index 8071e4e..459d86b 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/members_node.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/members_node.dart
@@ -146,6 +146,7 @@
ClassMember existing;
ClassMember duplicate;
assert(a.fileUri == b.fileUri ||
+ // Coverage-ignore(suite): Not run.
a.name.text == "toString" &&
(a.fileUri.isScheme("org-dartlang-sdk") &&
a.fileUri.pathSegments.isNotEmpty &&
@@ -155,6 +156,7 @@
b.fileUri.pathSegments.last == "enum.dart"));
if (a.fileUri != b.fileUri) {
+ // Coverage-ignore-block(suite): Not run.
if (a.fileUri.isScheme("org-dartlang-sdk")) {
existing = a;
duplicate = b;
@@ -281,6 +283,7 @@
DartType? inferredParameterType;
if (combinedMemberSignatureType == null) {
inferredParameterType = const InvalidType();
+ // Coverage-ignore(suite): Not run.
cantInferParameterTypes ??= [];
cantInferParameterTypes.add(declaredParameter);
} else {
@@ -670,6 +673,7 @@
if (tuple == null) {
memberMap[name] = new _Tuple.declareMember(classMember);
} else {
+ // Coverage-ignore-block(suite): Not run.
tuple.declaredMember = classMember;
}
if (name == noSuchMethodName &&
@@ -873,6 +877,7 @@
ClassHierarchyNodeDataForTesting? dataForTesting;
if (retainDataForTesting) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting = new ClassHierarchyNodeDataForTesting(
abstractMembers,
declaredOverridesMap,
@@ -967,6 +972,7 @@
computeClassInterfaceMember(noSuchMethodName, noSuchMethod);
}
noSuchMethodMember = interfaceMemberMap[noSuchMethodName] ??
+ // Coverage-ignore(suite): Not run.
classMemberMap[noSuchMethodName];
memberMap.forEach(computeClassInterfaceMember);
@@ -1028,20 +1034,24 @@
/// the interface members separately.
assert(
classMemberMap.length == interfaceMemberMap.length,
+ // Coverage-ignore(suite): Not run.
"Class/interface member mismatch. Class members: "
"$classMemberMap, interface members: $interfaceMemberMap.");
assert(
classSetterMap.length == interfaceSetterMap.length,
+ // Coverage-ignore(suite): Not run.
"Class/interface setter mismatch. Class setters: "
"$classSetterMap, interface setters: $interfaceSetterMap.");
assert(
classMemberMap.keys.every((Name name) =>
identical(classMemberMap[name], interfaceMemberMap?[name])),
+ // Coverage-ignore(suite): Not run.
"Class/interface member mismatch. Class members: "
"$classMemberMap, interface members: $interfaceMemberMap.");
assert(
classSetterMap.keys.every((Name name) =>
identical(classSetterMap[name], interfaceSetterMap?[name])),
+ // Coverage-ignore(suite): Not run.
"Class/interface setter mismatch. Class setters: "
"$classSetterMap, interface setters: $interfaceSetterMap.");
interfaceMemberMap = null;
@@ -1155,6 +1165,7 @@
return "$sb";
}
+ // Coverage-ignore(suite): Not run.
void printMembers(
List<ClassMember> members, StringBuffer sb, String heading) {
sb.write(" ");
@@ -1170,6 +1181,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
void printMemberMap(
Map<Name, ClassMember> memberMap, StringBuffer sb, String heading) {
List<ClassMember> members = memberMap.values.toList();
@@ -1194,8 +1206,11 @@
}
ClassMember? getDispatchTarget(Name name, bool isSetter) {
- ClassMember? result =
- isSetter ? classSetterMap[name] : classMemberMap[name];
+ ClassMember? result = isSetter
+ ?
+ // Coverage-ignore(suite): Not run.
+ classSetterMap[name]
+ : classMemberMap[name];
if (result == null) {
return null;
}
@@ -1208,6 +1223,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class ClassHierarchyNodeDataForTesting {
final List<ClassMember> abstractMembers;
final Map<ClassMember, Set<ClassMember>> declaredOverrides;
@@ -1272,6 +1288,7 @@
ClassMember? get declaredMember => _declaredGetable;
+ // Coverage-ignore(suite): Not run.
void set declaredMember(ClassMember? value) {
assert(!value!.forSetter);
assert(
@@ -1287,6 +1304,7 @@
assert(value!.forSetter);
assert(
_declaredSetable == null,
+ // Coverage-ignore(suite): Not run.
"Declared setter already set to $_declaredSetable, "
"trying to set it to $value.");
_declaredSetable = value;
@@ -1298,6 +1316,7 @@
assert(!value!.forSetter);
assert(
_extendedGetable == null,
+ // Coverage-ignore(suite): Not run.
"Extended member already set to $_extendedGetable, "
"trying to set it to $value.");
_extendedGetable = value;
@@ -1309,6 +1328,7 @@
assert(value!.forSetter);
assert(
_extendedSetable == null,
+ // Coverage-ignore(suite): Not run.
"Extended setter already set to $_extendedSetable, "
"trying to set it to $value.");
_extendedSetable = value;
@@ -1320,6 +1340,7 @@
assert(!value!.forSetter);
assert(
_mixedInGetable == null,
+ // Coverage-ignore(suite): Not run.
"Mixed in member already set to $_mixedInGetable, "
"trying to set it to $value.");
_mixedInGetable = value;
@@ -1331,6 +1352,7 @@
assert(value!.forSetter);
assert(
_mixedInSetable == null,
+ // Coverage-ignore(suite): Not run.
"Mixed in setter already set to $_mixedInSetable, "
"trying to set it to $value.");
_mixedInSetable = value;
@@ -1502,6 +1524,7 @@
// The case is handled for consistency.
if (definingGetable.isStatic ||
definingGetable.isProperty != tupleMixedInMember.isProperty) {
+ // Coverage-ignore-block(suite): Not run.
builder.reportInheritanceConflict(
definingGetable, tupleMixedInMember);
} else {
@@ -1515,6 +1538,7 @@
!tupleMixedInSetter.isStatic &&
!tupleMixedInSetter.isDuplicate &&
!tupleMixedInSetter.isSynthesized) {
+ // Coverage-ignore-block(suite): Not run.
/// We treat
///
/// class Mixin {
@@ -1712,7 +1736,9 @@
if (implementedGetable == null) {
// On the first skipped member we add all previous.
implementedGetables ??= tupleImplementedMembers.take(i).toList();
- } else if (implementedGetables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (implementedGetables != null) {
// If already skipping members we add [implementedGetable]
// explicitly.
implementedGetables.add(implementedGetable);
@@ -1773,7 +1799,9 @@
if (implementedSetable == null) {
// On the first skipped setter we add all previous.
implementedSetables ??= tupleImplementedSetters.take(i).toList();
- } else if (implementedSetables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (implementedSetables != null) {
// If already skipping setters we add [implementedSetable]
// explicitly.
implementedSetables.add(implementedSetable);
@@ -2275,7 +2303,9 @@
/// method() {}
/// }
/// class Class extends Super {}
- assert(!_extendedMember.isAbstract,
+ assert(
+ !_extendedMember.isAbstract,
+ // Coverage-ignore(suite): Not run.
"Abstract extended member: ${_extendedMember}");
classMember = _extendedMember;
@@ -2616,6 +2646,7 @@
assert(
declaredMember.isSourceDeclaration &&
declaredMember.declarationBuilder.origin == _classBuilder,
+ // Coverage-ignore(suite): Not run.
"Only declared members can override: ${declaredMember}");
hasDeclaredMembers = true;
if (declaredMember.isProperty) {
@@ -2624,11 +2655,13 @@
} else {
assert(
declaredMethod == null,
+ // Coverage-ignore(suite): Not run.
"Multiple methods unexpectedly declared: "
"${declaredMethod} and ${declaredMember}.");
declaredMethod = declaredMember;
}
if (_dataForTesting != null && aliasForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
_dataForTesting.aliasMap[aliasForTesting] = declaredMember;
}
}
@@ -2659,7 +2692,9 @@
/// instead default to `dynamic`.
void registerMixedInOverride(ClassMember mixedInMember,
{ClassMember? aliasForTesting}) {
- assert(mixedInMember.declarationBuilder != _classBuilder,
+ assert(
+ mixedInMember.declarationBuilder != _classBuilder,
+ // Coverage-ignore(suite): Not run.
"Only mixin members can override by application: ${mixedInMember}");
if (_classBuilder is SourceClassBuilder) {
hasDeclaredMembers = true;
@@ -2669,11 +2704,13 @@
} else {
assert(
mixedInMethod == null,
+ // Coverage-ignore(suite): Not run.
"Multiple methods unexpectedly declared in mixin: "
"${mixedInMethod} and ${mixedInMember}.");
mixedInMethod = mixedInMember;
}
if (_dataForTesting != null && aliasForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
_dataForTesting.aliasMap[aliasForTesting] = mixedInMember;
}
}
@@ -2701,10 +2738,12 @@
if (_classBuilder is SourceClassBuilder) {
assert(
inheritedMember.declarationBuilder != _classBuilder,
+ // Coverage-ignore(suite): Not run.
"Only inherited members can implement by inheritance: "
"${inheritedMember}");
_inheritedImplementsMap[inheritedMember] = overrides;
if (_dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
_dataForTesting.aliasMap[aliasForTesting] = inheritedMember;
}
}
@@ -2811,6 +2850,7 @@
for (ClassMember member in members) {
if (member.hasDeclarations &&
declarationBuilder == member.declarationBuilder) {
+ // Coverage-ignore-block(suite): Not run.
_toSet(declarationBuilder, member.declarations, result);
} else {
result.add(member);
diff --git a/pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart b/pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart
index dec99cd..da797b5 100644
--- a/pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart
+++ b/pkg/front_end/lib/src/kernel/hierarchy/mixin_inferrer.dart
@@ -85,7 +85,9 @@
if (mixinSuperclass.implementedTypes.length == 2) {
s0 = mixinSuperclass.implementedTypes[0];
s1 = mixinSuperclass.implementedTypes[1];
- } else if (mixinSuperclass.implementedTypes.length == 1) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (mixinSuperclass.implementedTypes.length == 1) {
s0 = mixinSuperclass.supertype!;
s1 = mixinSuperclass.implementedTypes.first;
} else {
@@ -102,6 +104,7 @@
Supertype? supertype =
asInstantiationOf(baseType, mixinSupertype.classNode);
if (supertype == null) {
+ // Coverage-ignore-block(suite): Not run.
reportProblem(
templateMixinInferenceNoMatchingClass.withArguments(mixinClass.name,
baseType.classNode.name, mixinSupertype.asInterfaceType),
@@ -133,6 +136,7 @@
// Generate constraints based on the mixin's supertype.
generateConstraints(mixinClass, baseType, mixinSupertype);
if (_mixinInferenceSolution.isUnsolvable) {
+ // Coverage-ignore-block(suite): Not run.
reportProblem(
templateMixinInferenceNoMatchingClass.withArguments(mixinClass.name,
baseType.classNode.name, mixinSupertype.asInterfaceType),
@@ -141,6 +145,7 @@
// Generate new type parameters with the solution as bounds.
List<TypeParameter> parameters;
if (_mixinInferenceSolution.isUnsolvable) {
+ // Coverage-ignore-block(suite): Not run.
parameters = [...mixinClass.typeParameters];
} else {
parameters = [
@@ -177,11 +182,13 @@
return new Supertype(superclass, arguments);
}
+ // Coverage-ignore(suite): Not run.
void reportProblem(Message message, Class kernelClass) {
int length = cls.isMixinApplication ? 1 : cls.fullNameForErrors.length;
cls.addProblem(message, cls.charOffset, length);
}
+ // Coverage-ignore(suite): Not run.
Never reportUnsupportedProblem(String operation) {
return unsupported(operation, cls.charOffset, cls.fileUri);
}
@@ -226,21 +233,26 @@
return <TypeParameter, DartType>{type1.parameter: type2};
}
if (type2 is TypeParameterType &&
+ // Coverage-ignore(suite): Not run.
typeParametersToSolveFor.contains(type2.parameter)) {
+ // Coverage-ignore-block(suite): Not run.
return <TypeParameter, DartType>{type2.parameter: type1};
}
switch (type1) {
case AuxiliaryType():
+ // Coverage-ignore(suite): Not run.
return unsupportedErrorReporter.reportUnsupportedProblem(
"_MixinInferenceSolution._solveForEquality"
"(${type1.runtimeType}, ${type2.runtimeType})");
case InvalidType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! InvalidType) {
return null;
} else {
return <TypeParameter, DartType>{};
}
case DynamicType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! DynamicType) {
return null;
} else {
@@ -253,12 +265,14 @@
return <TypeParameter, DartType>{};
}
case NeverType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! NeverType) {
return null;
} else {
return <TypeParameter, DartType>{};
}
case NullType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! NullType) {
return null;
} else {
@@ -310,9 +324,11 @@
}
Map<String, NamedType> namedParameterByName1 = <String, NamedType>{
for (NamedType namedType in type1.namedParameters)
- namedType.name: namedType
+ namedType // Coverage-ignore(suite): Not run.
+ .name: namedType
};
for (NamedType namedType in type2.namedParameters) {
+ // Coverage-ignore-block(suite): Not run.
if (!namedParameterByName1.containsKey(namedType.name)) {
return null;
} else {
@@ -333,10 +349,12 @@
return result;
}
case TypedefType():
+ // Coverage-ignore(suite): Not run.
return unsupportedErrorReporter.reportUnsupportedProblem(
"_MixinInferenceSolution._solveForEquality"
"(${type1.runtimeType}, ${type2.runtimeType})");
case FutureOrType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! FutureOrType) {
return null;
} else {
@@ -344,11 +362,13 @@
unsupportedErrorReporter: unsupportedErrorReporter);
}
case IntersectionType():
+ // Coverage-ignore(suite): Not run.
// Intersection types can't appear in supertypes.
return unsupportedErrorReporter.reportUnsupportedProblem(
"_MixinInferenceSolution._solveForEquality"
"(${type1.runtimeType}, ${type2.runtimeType})");
case TypeParameterType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! TypeParameterType ||
type1.parameter != type2.parameter ||
type1.nullability != type2.nullability) {
@@ -366,6 +386,7 @@
return <TypeParameter, DartType>{};
}
case RecordType():
+ // Coverage-ignore(suite): Not run.
if (type2 is! RecordType) {
return null;
} else {
@@ -429,6 +450,7 @@
}
return result;
}
+ // Coverage-ignore(suite): Not run.
case ExtensionType():
if (type2 is! ExtensionType) {
return null;
@@ -463,6 +485,7 @@
} else {
for (TypeParameter typeParameter in result1.keys) {
if (result2.containsKey(typeParameter)) {
+ // Coverage-ignore-block(suite): Not run.
if (result1[typeParameter] != result2[typeParameter]) {
return null;
}
diff --git a/pkg/front_end/lib/src/kernel/implicit_field_type.dart b/pkg/front_end/lib/src/kernel/implicit_field_type.dart
index 9c9ffc5..a593ea6 100644
--- a/pkg/front_end/lib/src/kernel/implicit_field_type.dart
+++ b/pkg/front_end/lib/src/kernel/implicit_field_type.dart
@@ -35,45 +35,54 @@
_InferredTypeUse;
@override
+ // Coverage-ignore(suite): Not run.
Nullability get declaredNullability =>
unsupported("declaredNullability", charOffset ?? -1, fileUri);
@override
+ // Coverage-ignore(suite): Not run.
Nullability get nullability {
unsupported("nullability", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType get nonTypeVariableBound {
throw unsupported("nonTypeVariableBound", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
bool get hasNonObjectMemberAccess {
throw unsupported("hasNonObjectMemberAccess", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
R accept<R>(DartTypeVisitor<R> v) {
throw unsupported("accept", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
R accept1<R, A>(DartTypeVisitor1<R, A> v, arg) {
throw unsupported("accept1", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
Never visitChildren(Visitor<dynamic> v) {
unsupported("visitChildren", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
InferredType withDeclaredNullability(Nullability nullability) {
return unsupported("withNullability", charOffset ?? -1, fileUri);
}
@override
+ // Coverage-ignore(suite): Not run.
InferredType toNonNull() {
return unsupported("toNonNullable", charOffset ?? -1, fileUri);
}
@@ -92,9 +101,11 @@
_ImplicitFieldTypeRoot(this.fieldBuilder, this.initializerToken) : super._();
@override
+ // Coverage-ignore(suite): Not run.
Uri get fileUri => fieldBuilder.fileUri;
@override
+ // Coverage-ignore(suite): Not run.
int get charOffset => fieldBuilder.charOffset;
@override
@@ -134,7 +145,10 @@
fieldBuilder.fileUri,
enclosingClassThisType,
fieldBuilder.libraryBuilder,
- fieldBuilder.dataForTesting?.inferenceData);
+ fieldBuilder
+ .dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.inferenceData);
BodyBuilderContext bodyBuilderContext =
fieldBuilder.createBodyBuilderContext(
inOutlineBuildingPhase: false,
@@ -166,11 +180,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('<implicit-field-type:$fieldBuilder>');
}
@override
+ // Coverage-ignore(suite): Not run.
bool equals(Object other, Assumptions? assumptions) {
if (identical(this, other)) return true;
return other is _ImplicitFieldTypeRoot &&
@@ -190,27 +206,33 @@
_InferredTypeUse(this.inferableTypeUse) : super._();
@override
+ // Coverage-ignore(suite): Not run.
int? get charOffset => inferableTypeUse.typeBuilder.charOffset;
@override
+ // Coverage-ignore(suite): Not run.
Uri? get fileUri => inferableTypeUse.typeBuilder.fileUri;
@override
+ // Coverage-ignore(suite): Not run.
DartType computeType(ClassHierarchyBase hierarchy) {
return inferType(hierarchy);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType inferType(ClassHierarchyBase hierarchy) {
return inferableTypeUse.inferType(hierarchy);
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('<inferred-type:${inferableTypeUse.typeBuilder}>');
}
@override
+ // Coverage-ignore(suite): Not run.
bool equals(Object other, Assumptions? assumptions) {
if (identical(this, other)) return true;
return other is _InferredTypeUse &&
diff --git a/pkg/front_end/lib/src/kernel/implicit_type_argument.dart b/pkg/front_end/lib/src/kernel/implicit_type_argument.dart
index 9cc0ec9..b59ad00 100644
--- a/pkg/front_end/lib/src/kernel/implicit_type_argument.dart
+++ b/pkg/front_end/lib/src/kernel/implicit_type_argument.dart
@@ -26,51 +26,62 @@
const ImplicitTypeArgument();
@override
+ // Coverage-ignore(suite): Not run.
Nullability get declaredNullability =>
unsupported("declaredNullability", -1, null);
@override
+ // Coverage-ignore(suite): Not run.
Nullability get nullability => unsupported("nullability", -1, null);
@override
+ // Coverage-ignore(suite): Not run.
DartType get nonTypeVariableBound {
throw unsupported("nonTypeVariableBound", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
bool get hasNonObjectMemberAccess {
throw unsupported("hasNonObjectMemberAccess", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
R accept<R>(DartTypeVisitor<R> v) {
throw unhandled("$runtimeType", "${v.runtimeType}", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
R accept1<R, A>(DartTypeVisitor1<R, A> v, A arg) {
return unhandled("$runtimeType", "${v.runtimeType}", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
Never visitChildren(Visitor v) {
unhandled("$runtimeType", "${v.runtimeType}", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
ImplicitTypeArgument withDeclaredNullability(Nullability nullability) {
return unsupported("withDeclaredNullability", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
ImplicitTypeArgument toNonNull() {
return unsupported("toNonNullable", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
bool equals(Object other, Assumptions? assumptions) => this == other;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('<implicit-type-argument>');
}
diff --git a/pkg/front_end/lib/src/kernel/internal_ast.dart b/pkg/front_end/lib/src/kernel/internal_ast.dart
index eca8795..41531c1 100644
--- a/pkg/front_end/lib/src/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/kernel/internal_ast.dart
@@ -124,6 +124,7 @@
return new ExtensionMethodTypeArgumentsInfo(arguments);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
// This code path should only be taken in situations where there are no
// type arguments at all, e.g. calling a user-definable operator.
assert(arguments.types.isEmpty);
@@ -143,6 +144,7 @@
.toList();
}
} else {
+ // Coverage-ignore-block(suite): Not run.
// This code path should only be taken in situations where there are no
// type arguments at all, e.g. calling a user-definable operator.
assert(arguments.types.isEmpty);
@@ -156,28 +158,33 @@
mixin InternalTreeNode implements TreeNode {
@override
+ // Coverage-ignore(suite): Not run.
void replaceChild(TreeNode child, TreeNode replacement) {
// Do nothing. The node should not be part of the resulting AST, anyway.
}
@override
+ // Coverage-ignore(suite): Not run.
void transformChildren(Transformer v) {
unsupported(
"${runtimeType}.transformChildren on ${v.runtimeType}", -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
void transformOrRemoveChildren(RemovingTransformer v) {
unsupported("${runtimeType}.transformOrRemoveChildren on ${v.runtimeType}",
-1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor v) {
unsupported("${runtimeType}.visitChildren on ${v.runtimeType}", -1, null);
}
}
+// Coverage-ignore(suite): Not run.
/// Common base class for internal statements.
abstract class InternalStatement extends AuxiliaryStatement {
@override
@@ -231,6 +238,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter state) {
// TODO(johnniwinther): Implement this.
}
@@ -258,6 +266,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('try ');
printer.writeStatement(tryBlock);
@@ -299,6 +308,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (isContinue) {
printer.write('continue ');
@@ -310,6 +320,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Common base class for internal expressions.
abstract class InternalExpression extends AuxiliaryExpression {
@override
@@ -346,6 +357,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Common base class for internal initializers.
abstract class InternalInitializer extends AuxiliaryInitializer {
@override
@@ -526,6 +538,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('let ');
printer.writeVariableDeclaration(variable);
@@ -569,6 +582,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('let ');
printer.writeVariableDeclaration(variable);
@@ -608,6 +622,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (isConst) {
printer.write('const ');
@@ -648,6 +663,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (isConst) {
printer.write('const ');
@@ -688,6 +704,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (isConst) {
printer.write('const ');
@@ -749,6 +766,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(left, minimumPrecedence: Precedence.CONDITIONAL);
printer.write(' ?? ');
@@ -773,6 +791,7 @@
double? asDouble({bool negated = false}) {
if (value == 0 && negated) {
+ // Coverage-ignore-block(suite): Not run.
return -0.0;
}
BigInt intValue = new BigInt.from(negated ? -value : value);
@@ -794,6 +813,7 @@
@override
void toTextInternal(AstPrinter printer) {
if (literal == null) {
+ // Coverage-ignore-block(suite): Not run.
printer.write('$value');
} else {
printer.write(literal!);
@@ -809,6 +829,7 @@
ShadowLargeIntLiteral(this.literal, this.fileOffset) : super(0);
+ // Coverage-ignore(suite): Not run.
double? asDouble({bool negated = false}) {
BigInt? intValue = BigInt.tryParse(negated ? '-${literal}' : literal);
if (intValue == null) {
@@ -838,6 +859,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write(literal);
}
@@ -902,6 +924,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(expression);
printer.writeArguments(arguments);
@@ -938,6 +961,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
Expression methodInvocation = invocation;
if (methodInvocation is InstanceInvocation) {
@@ -999,6 +1023,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
Expression propertyGet = read;
if (propertyGet is PropertyGet) {
@@ -1048,6 +1073,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
Expression propertySet = write;
if (propertySet is InstanceSet) {
@@ -1094,6 +1120,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (isArrow) {
printer.write('=>');
@@ -1219,6 +1246,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeVariableDeclaration(this,
isLate: isLate || lateGetter != null, type: lateType ?? type);
@@ -1259,6 +1287,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write(import.name!);
printer.write('.loadLibrary');
@@ -1289,6 +1318,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write(import.name!);
printer.write('.loadLibrary');
@@ -1345,6 +1375,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('.');
@@ -1392,6 +1423,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(read);
printer.write(' ?? ');
@@ -1547,6 +1579,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('.');
@@ -1690,6 +1723,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('[');
@@ -1741,6 +1775,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('[');
@@ -1849,6 +1884,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write(extension.name);
if (explicitTypeArguments != null) {
@@ -2137,6 +2173,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('[');
@@ -2245,6 +2282,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('?.');
@@ -2332,6 +2370,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver);
printer.write('?.');
@@ -2646,6 +2685,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(left, minimumPrecedence: Precedence.EQUALITY);
if (isNot) {
@@ -2680,9 +2720,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.binaryPrecedence[binaryName.text]!;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(left, minimumPrecedence: precedence);
printer.write(' ${binaryName.text} ');
@@ -2706,6 +2748,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.PREFIX;
@override
@@ -2714,6 +2757,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (unaryName == unaryMinusName) {
printer.write('-');
@@ -2739,6 +2783,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.CALLEE;
@override
@@ -2747,6 +2792,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('(');
printer.writeExpression(expression);
@@ -2776,11 +2822,13 @@
} else if (node is VariableGet) {
assert(
node.variable.isFinal && !node.variable.isLate,
+ // Coverage-ignore(suite): Not run.
"Trying to clone VariableGet of non-final variable"
" ${node.variable}.");
return new VariableGet(node.variable, node.promotedType)
..fileOffset = node.fileOffset;
}
+ // Coverage-ignore-block(suite): Not run.
throw new UnsupportedError("Clone not supported for ${node.runtimeType}.");
}
@@ -2813,9 +2861,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.PRIMARY;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver, minimumPrecedence: Precedence.PRIMARY);
printer.write('.');
@@ -2850,9 +2900,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.PRIMARY;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver, minimumPrecedence: Precedence.PRIMARY);
printer.write('.');
@@ -2895,6 +2947,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeExpression(receiver, minimumPrecedence: Precedence.PRIMARY);
printer.write('.');
@@ -2931,9 +2984,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.PRIMARY;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('augment super');
printer.writeArguments(arguments);
@@ -2964,9 +3019,11 @@
}
@override
+ // Coverage-ignore(suite): Not run.
int get precedence => Precedence.PRIMARY;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('augment super');
}
@@ -3002,6 +3059,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('augment super = ');
printer.writeExpression(value);
@@ -3033,6 +3091,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
if (isConst) {
printer.write('const ');
@@ -3086,6 +3145,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('if (');
printer.writeExpression(expression);
@@ -3112,6 +3172,7 @@
MapLiteralEntry? otherwiseEntry;
Expression? otherwise = this.otherwise;
if (otherwise != null) {
+ // Coverage-ignore-block(suite): Not run.
if (otherwise is ControlFlowElement) {
ControlFlowElement otherwiseElement = otherwise;
otherwiseEntry = otherwiseElement.toMapLiteralEntry(onConvertElement);
@@ -3162,6 +3223,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('if (');
expression.toTextInternal(printer);
@@ -3214,6 +3276,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
patternVariableDeclaration.toTextInternal(printer);
printer.write('for (');
@@ -3273,6 +3336,7 @@
required this.body});
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
patternVariableDeclaration.toTextInternal(printer);
printer.write('for (');
@@ -3332,6 +3396,7 @@
Procedure get target => targetReference.asProcedure;
+ // Coverage-ignore(suite): Not run.
void set target(Procedure target) {
// Getter vs setter doesn't matter for procedures.
targetReference = getNonNullableMemberReferenceGetter(target);
@@ -3343,6 +3408,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('this');
if (target.name.text.isNotEmpty) {
@@ -3383,6 +3449,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.writeMemberName(fieldReference);
printer.write(" = ");
diff --git a/pkg/front_end/lib/src/kernel/invalid_type.dart b/pkg/front_end/lib/src/kernel/invalid_type.dart
index 02567ce..d65d719 100644
--- a/pkg/front_end/lib/src/kernel/invalid_type.dart
+++ b/pkg/front_end/lib/src/kernel/invalid_type.dart
@@ -21,6 +21,7 @@
const _InvalidTypeFinder();
@override
+ // Coverage-ignore(suite): Not run.
bool visitAuxiliaryType(
AuxiliaryType node, Set<TypedefType> visitedTypedefs) {
if (node is UnknownType) {
@@ -89,6 +90,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitTypedefType(TypedefType node, Set<TypedefType> visitedTypedefs) {
// The unaliased type should be checked, but it's faster to check the type
// arguments and the RHS separately than do the unaliasing because it avoids
@@ -119,6 +121,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitIntersectionType(
IntersectionType node, Set<TypedefType> visitedTypedefs) {
return node.right.accept1(this, visitedTypedefs);
diff --git a/pkg/front_end/lib/src/kernel/kernel_constants.dart b/pkg/front_end/lib/src/kernel/kernel_constants.dart
index f5f127a..3873057 100644
--- a/pkg/front_end/lib/src/kernel/kernel_constants.dart
+++ b/pkg/front_end/lib/src/kernel/kernel_constants.dart
@@ -19,8 +19,10 @@
// Try to find library.
Uri uri = message.uri!;
CompilationUnit? compilationUnit = loader.lookupCompilationUnit(uri);
+ // Coverage-ignore(suite): Not run.
compilationUnit ??= loader.lookupCompilationUnitByFileUri(uri);
if (compilationUnit == null) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(jensj): Probably a part or something.
loader.addProblem(message.messageObject, message.charOffset,
message.length, message.uri,
diff --git a/pkg/front_end/lib/src/kernel/kernel_helper.dart b/pkg/front_end/lib/src/kernel/kernel_helper.dart
index 4fb1ec5..9ef59b6 100644
--- a/pkg/front_end/lib/src/kernel/kernel_helper.dart
+++ b/pkg/front_end/lib/src/kernel/kernel_helper.dart
@@ -309,6 +309,7 @@
Expression annotation = annotations[i];
if (annotation is FileUriExpression &&
annotation.fileUri == annotatableFileUri) {
+ // Coverage-ignore-block(suite): Not run.
annotations[i] = annotation.expression..parent = annotatable;
}
}
diff --git a/pkg/front_end/lib/src/kernel/kernel_target.dart b/pkg/front_end/lib/src/kernel/kernel_target.dart
index cfc616c..ff96c8b 100644
--- a/pkg/front_end/lib/src/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/kernel/kernel_target.dart
@@ -198,6 +198,7 @@
accessor: loader.coreLibraryCompilationUnit);
}
if (context.compilingPlatform) {
+ // Coverage-ignore-block(suite): Not run.
for (String uri in backendTarget.extraRequiredLibrariesPlatform) {
loader.read(Uri.parse(uri), 0,
accessor: loader.coreLibraryCompilationUnit);
@@ -217,7 +218,9 @@
return processedOptions.format(
fileUri != null
? message.withLocation(fileUri, charOffset, length)
- : message.withoutLocation(),
+ :
+ // Coverage-ignore(suite): Not run.
+ message.withoutLocation(),
severity,
messageContext,
involvedFiles: involvedFiles);
@@ -262,6 +265,7 @@
Source source = new Source(lineStarts, sourceCode, importUri, fileUri);
uriToSource[fileUri] = source;
if (_hasAddedSources) {
+ // Coverage-ignore-block(suite): Not run.
// The sources have already been added to the component in [link] so we
// have to add source directly here to create a consistent component.
component?.uriToSource[fileUri] = excludeSource
@@ -271,6 +275,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
void removeSourceInformation(Uri fileUri) {
uriToSource.remove(fileUri);
if (_hasAddedSources) {
@@ -308,10 +313,12 @@
String packageName = package.name;
Uri packageUri = package.packageUriRoot;
if (packageUri.hasFragment == true) {
+ // Coverage-ignore-block(suite): Not run.
packageUri = packageUri.removeFragment();
}
String prefix = "${packageUri}";
if (asString.startsWith(prefix)) {
+ // Coverage-ignore-block(suite): Not run.
Uri reversed = Uri.parse(
"package:$packageName/${asString.substring(prefix.length)}");
if (entryPoint == uriTranslator.translate(reversed)) {
@@ -332,27 +339,37 @@
_hasComputedNeededPrecompilations = true;
if (loader.roots.isEmpty) return null;
return await withCrashReporting<NeededPrecompilations?>(() async {
- benchmarker?.enterPhase(BenchmarkPhases.outline_kernelBuildOutlines);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_kernelBuildOutlines);
await loader.buildOutlines();
- benchmarker?.enterPhase(BenchmarkPhases.outline_resolveParts);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_resolveParts);
loader.resolveParts();
- benchmarker?.enterPhase(BenchmarkPhases.outline_becomeCoreLibrary);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_becomeCoreLibrary);
loader.coreLibrary.becomeCoreLibrary();
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeMacroDeclarations);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeMacroDeclarations);
NeededPrecompilations? result =
context.options.globalFeatures.macros.isEnabled
? loader.computeMacroDeclarations()
: null;
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.unknownComputeNeededPrecompilations);
return result;
}, () => loader.currentUriForCrashReporting);
}
+ // Coverage-ignore(suite): Not run.
/// Builds [augmentationLibraries] to the state expected after applying phase
/// 1 macros.
Future<void> _buildForPhase1(MacroApplications macroApplications,
@@ -374,6 +391,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
/// Builds [augmentationLibraries] to the state expected after applying phase
/// 2 macros.
void _buildForPhase2(List<SourceLibraryBuilder> augmentationLibraries) {
@@ -385,6 +403,7 @@
loader.resolveConstructors(augmentationLibraries);
}
+ // Coverage-ignore(suite): Not run.
Future<void> _applyMacroPhase2(
MacroApplications macroApplications,
List<SourceClassBuilder> sortedSourceClassBuilders,
@@ -415,6 +434,7 @@
await applyDeclarationMacros();
}
+ // Coverage-ignore(suite): Not run.
/// Builds [augmentationLibraries] to the state expected after applying phase
/// 3 macros.
void _buildForPhase3(List<SourceLibraryBuilder> augmentationLibraries) {
@@ -423,10 +443,12 @@
Future<BuildResult> buildOutlines({CanonicalName? nameRoot}) async {
if (loader.roots.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
return new BuildResult();
}
return await withCrashReporting<BuildResult>(() async {
if (!_hasComputedNeededPrecompilations) {
+ // Coverage-ignore-block(suite): Not run.
NeededPrecompilations? neededPrecompilations =
await computeNeededPrecompilations();
// To support macros, the needed macro libraries must be compiled be
@@ -441,27 +463,40 @@
}
}
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeLibraryScopes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeLibraryScopes);
loader.computeLibraryScopes(loader.loadedLibraryBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeMacroApplications);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeMacroApplications);
MacroApplications? macroApplications =
await loader.computeMacroApplications();
- benchmarker?.enterPhase(BenchmarkPhases.outline_setupTopAndBottomTypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_setupTopAndBottomTypes);
setupTopAndBottomTypes();
- benchmarker?.enterPhase(BenchmarkPhases.outline_resolveTypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_resolveTypes);
loader.resolveTypes(loader.sourceLibraryBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeVariances);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeVariances);
loader.computeVariances(loader.sourceLibraryBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeDefaultTypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeDefaultTypes);
loader.computeDefaultTypes(
dynamicType, nullType, bottomType, objectClassBuilder);
if (macroApplications != null) {
+ // Coverage-ignore-block(suite): Not run.
benchmarker?.enterPhase(BenchmarkPhases.outline_applyTypeMacros);
macroApplications.enterTypeMacroPhase();
List<SourceLibraryBuilder> augmentationLibraries =
@@ -471,39 +506,56 @@
await _buildForPhase1(macroApplications, augmentationLibraries);
}
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkSemantics);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkSemantics);
List<SourceClassBuilder>? sortedSourceClassBuilders;
List<SourceExtensionTypeDeclarationBuilder>?
sortedSourceExtensionTypeBuilders;
(sortedSourceClassBuilders, sortedSourceExtensionTypeBuilders) =
loader.checkClassCycles(objectClassBuilder);
- benchmarker?.enterPhase(BenchmarkPhases.outline_finishTypeVariables);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_finishTypeVariables);
loader.finishTypeVariables(
loader.sourceLibraryBuilders, objectClassBuilder, dynamicType);
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_createTypeInferenceEngine);
loader.createTypeInferenceEngine();
- benchmarker?.enterPhase(BenchmarkPhases.outline_buildComponent);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_buildComponent);
loader.buildOutlineNodes();
- benchmarker?.enterPhase(BenchmarkPhases.outline_installDefaultSupertypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_installDefaultSupertypes);
installDefaultSupertypes();
- benchmarker?.enterPhase(BenchmarkPhases.outline_link);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_link);
component =
link(new List<Library>.of(loader.libraries), nameRoot: nameRoot);
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeCoreTypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeCoreTypes);
computeCoreTypes();
- benchmarker?.enterPhase(BenchmarkPhases.outline_buildClassHierarchy);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_buildClassHierarchy);
loader.buildClassHierarchy(sortedSourceClassBuilders,
sortedSourceExtensionTypeBuilders, objectClassBuilder);
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkSupertypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkSupertypes);
loader.checkSupertypes(
sortedSourceClassBuilders,
sortedSourceExtensionTypeBuilders,
@@ -512,29 +564,40 @@
underscoreEnumClass);
if (macroApplications != null) {
+ // Coverage-ignore-block(suite): Not run.
await _applyMacroPhase2(macroApplications, sortedSourceClassBuilders,
sortedSourceExtensionTypeBuilders);
}
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_installSyntheticConstructors);
installSyntheticConstructors(sortedSourceClassBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_resolveConstructors);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_resolveConstructors);
loader.resolveConstructors(loader.sourceLibraryBuilders);
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_buildClassHierarchyMembers);
loader.buildClassHierarchyMembers(
sortedSourceClassBuilders, sortedSourceExtensionTypeBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeHierarchy);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeHierarchy);
loader.computeHierarchy();
- benchmarker?.enterPhase(BenchmarkPhases.outline_computeShowHideElements);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_computeShowHideElements);
loader.computeShowHideElements();
- benchmarker?.enterPhase(BenchmarkPhases.outline_installTypedefTearOffs);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_installTypedefTearOffs);
List<DelayedDefaultValueCloner>?
typedefTearOffsDelayedDefaultValueCloners =
loader.installTypedefTearOffs();
@@ -542,49 +605,69 @@
?.forEach(registerDelayedDefaultValueCloner);
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_computeFieldPromotability);
loader.computeFieldPromotability();
- benchmarker?.enterPhase(BenchmarkPhases.outline_performTopLevelInference);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_performTopLevelInference);
loader.performTopLevelInference(sortedSourceClassBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkOverrides);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkOverrides);
loader.checkOverrides(sortedSourceClassBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkAbstractMembers);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkAbstractMembers);
loader.checkAbstractMembers(sortedSourceClassBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkMixins);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkMixins);
loader.checkMixins(sortedSourceClassBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.outline_buildOutlineExpressions);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_buildOutlineExpressions);
// TODO(johnniwinther): Add an interface for registering delayed actions.
List<DelayedDefaultValueCloner> delayedDefaultValueCloners = [];
loader.buildOutlineExpressions(
loader.hierarchy, delayedDefaultValueCloners);
delayedDefaultValueCloners.forEach(registerDelayedDefaultValueCloner);
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkTypes);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkTypes);
loader.checkTypes();
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_checkRedirectingFactories);
loader.checkRedirectingFactories(
sortedSourceClassBuilders, sortedSourceExtensionTypeBuilders);
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_finishSynthesizedParameters);
finishSynthesizedParameters(forOutline: true);
- benchmarker?.enterPhase(BenchmarkPhases.outline_checkMainMethods);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.outline_checkMainMethods);
loader.checkMainMethods();
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.outline_installAllComponentProblems);
installAllComponentProblems(loader.allComponentProblems);
loader.allComponentProblems.clear();
- benchmarker?.enterPhase(BenchmarkPhases.unknownBuildOutlines);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.unknownBuildOutlines);
// For whatever reason sourceClassBuilders is kept alive for some amount
// of time, meaning that all source library builders will be kept alive
@@ -610,12 +693,14 @@
bool verify = false,
bool allowVerificationErrorForTesting = false}) async {
if (loader.roots.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
return new BuildResult(macroApplications: macroApplications);
}
return await withCrashReporting<BuildResult>(() async {
ticker.logMs("Building component");
if (macroApplications != null) {
+ // Coverage-ignore-block(suite): Not run.
benchmarker?.enterPhase(BenchmarkPhases.body_applyDefinitionMacros);
macroApplications.enterDefinitionMacroPhase();
List<SourceLibraryBuilder> augmentationLibraries =
@@ -631,58 +716,85 @@
_buildForPhase3(augmentationLibraries);
}
- benchmarker?.enterPhase(BenchmarkPhases.body_buildBodies);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_buildBodies);
await loader.buildBodies(loader.sourceLibraryBuilders);
- benchmarker?.enterPhase(BenchmarkPhases.body_checkMixinSuperAccesses);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_checkMixinSuperAccesses);
loader.checkMixinSuperAccesses();
- benchmarker?.enterPhase(BenchmarkPhases.body_finishSynthesizedParameters);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_finishSynthesizedParameters);
finishSynthesizedParameters();
- benchmarker?.enterPhase(BenchmarkPhases.body_finishDeferredLoadTearoffs);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_finishDeferredLoadTearoffs);
loader.finishDeferredLoadTearoffs();
benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.body_finishNoSuchMethodForwarders);
loader.finishNoSuchMethodForwarders();
- benchmarker?.enterPhase(BenchmarkPhases.body_collectSourceClasses);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_collectSourceClasses);
List<SourceClassBuilder>? sourceClasses = [];
List<SourceExtensionTypeDeclarationBuilder>? extensionTypeDeclarations =
[];
loader.collectSourceClasses(sourceClasses, extensionTypeDeclarations);
- benchmarker?.enterPhase(BenchmarkPhases.body_finishNativeMethods);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_finishNativeMethods);
loader.finishNativeMethods();
- benchmarker?.enterPhase(BenchmarkPhases.body_finishAugmentationMethods);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_finishAugmentationMethods);
loader.buildBodyNodes();
- benchmarker?.enterPhase(BenchmarkPhases.body_finishAllConstructors);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_finishAllConstructors);
finishAllConstructors(sourceClasses, extensionTypeDeclarations);
- benchmarker?.enterPhase(BenchmarkPhases.body_runBuildTransformations);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_runBuildTransformations);
runBuildTransformations();
if (loader.macroClass != null) {
+ // Coverage-ignore-block(suite): Not run.
checkMacroApplications(loader.hierarchy, loader.macroClass!,
loader.sourceLibraryBuilders, macroApplications);
}
if (macroApplications != null) {
+ // Coverage-ignore-block(suite): Not run.
macroApplications.buildMergedAugmentationLibraries(component!);
}
if (verify) {
- benchmarker?.enterPhase(BenchmarkPhases.body_verify);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_verify);
_verify(
allowVerificationErrorForTesting: allowVerificationErrorForTesting);
}
- benchmarker?.enterPhase(BenchmarkPhases.body_installAllComponentProblems);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.body_installAllComponentProblems);
installAllComponentProblems(loader.allComponentProblems);
- benchmarker?.enterPhase(BenchmarkPhases.unknownBuildComponent);
+ benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.unknownBuildComponent);
// For whatever reason sourceClasses is kept alive for some amount
// of time, meaning that all source library builders will be kept alive
@@ -691,7 +803,9 @@
sourceClasses = null;
extensionTypeDeclarations = null;
- context.options.hooksForTesting?.onBuildComponentComplete(component!);
+ context.options.hooksForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.onBuildComponentComplete(component!);
return new BuildResult(
component: component, macroApplications: macroApplications);
@@ -720,7 +834,9 @@
Map<Uri, Source> uriToSource = new Map<Uri, Source>();
void copySource(Uri uri, Source source) {
uriToSource[uri] = excludeSource
- ? new Source(source.lineStarts, const <int>[], source.importUri,
+ ?
+ // Coverage-ignore(suite): Not run.
+ new Source(source.lineStarts, const <int>[], source.importUri,
source.fileUri)
: source;
}
@@ -756,6 +872,7 @@
Builder? declaration =
firstRoot.exportScope.lookup("main", -1, firstRoot.fileUri);
if (declaration is AmbiguousBuilder) {
+ // Coverage-ignore-block(suite): Not run.
AmbiguousBuilder problem = declaration;
declaration = problem.getFirstDeclaration();
}
@@ -765,7 +882,9 @@
}
component.setMainMethodAndMode(mainReference, true, compiledMode);
- assert(_getLibraryNnbdModeError(component) == null,
+ assert(
+ _getLibraryNnbdModeError(component) == null,
+ // Coverage-ignore(suite): Not run.
"Got error: ${_getLibraryNnbdModeError(component)}");
ticker.logMs("Linked component");
@@ -818,10 +937,13 @@
if (component.mode == NonNullableByDefaultCompiledMode.Strong) {
if (library.nonNullableByDefaultCompiledMode !=
NonNullableByDefaultCompiledMode.Strong) {
+ // Coverage-ignore-block(suite): Not run.
return "Expected library ${library.importUri} to be strong, "
"but was ${library.nonNullableByDefaultCompiledMode}";
}
- } else if (component.mode == NonNullableByDefaultCompiledMode.Weak) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (component.mode == NonNullableByDefaultCompiledMode.Weak) {
if (library.nonNullableByDefaultCompiledMode !=
NonNullableByDefaultCompiledMode.Weak) {
return "Expected library ${library.importUri} to be weak, "
@@ -1004,6 +1126,7 @@
}
if (!isConstructorAdded) {
+ // Coverage-ignore-block(suite): Not run.
builder.addSyntheticConstructor(_makeDefaultConstructor(
builder, constructorReference, tearOffReference));
}
@@ -1014,6 +1137,7 @@
case ExtensionTypeDeclarationBuilder():
case InvalidTypeDeclarationBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -1276,6 +1400,7 @@
}
}
if (!found && uri.path != "mirrors") {
+ // Coverage-ignore-block(suite): Not run.
// dart:mirrors is optional.
throw "Can't find $uri";
}
@@ -1342,7 +1467,10 @@
Initializer initializer;
if (superTarget == null) {
int offset = constructor.fileOffset;
- if (offset == -1 && constructor.isSynthetic) {
+ if (offset == -1 &&
+ // Coverage-ignore(suite): Not run.
+ constructor.isSynthetic) {
+ // Coverage-ignore-block(suite): Not run.
offset = cls.fileOffset;
}
classBuilder.addProblem(
@@ -1360,6 +1488,7 @@
initializer.parent = constructor;
}
if (constructor.function.body == null) {
+ // Coverage-ignore-block(suite): Not run.
/// >If a generative constructor c is not a redirecting constructor
/// >and no body is provided, then c implicitly has an empty body {}.
/// We use an empty statement instead.
@@ -1470,7 +1599,9 @@
if (uri == 'dart:html' ||
uri == 'dart:svg' ||
uri == 'dart:_native_typed_data' ||
- uri == 'dart:_interceptors' && file == 'js_string.dart') {
+ uri == 'dart:_interceptors' &&
+ // Coverage-ignore(suite): Not run.
+ file == 'js_string.dart') {
// TODO(johnniwinther): Use external getters instead of final
// fields. See https://github.com/dart-lang/sdk/issues/33762
} else {
@@ -1548,7 +1679,9 @@
loader.coreTypes,
loader.libraries,
new KernelDiagnosticReporter(loader),
- logger: (String msg) => ticker.logMs(msg),
+ logger:
+ // Coverage-ignore(suite): Not run.
+ (String msg) => ticker.logMs(msg),
changedStructureNotifier: changedStructureNotifier);
TypeEnvironment environment =
@@ -1570,8 +1703,10 @@
enableConstructorTearOff:
globalFeatures.constructorTearoffs.isEnabled,
errorOnUnevaluatedConstant: errorOnUnevaluatedConstant,
- exhaustivenessDataForTesting:
- loader.dataForTesting?.exhaustivenessData);
+ exhaustivenessDataForTesting: loader
+ .dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.exhaustivenessData);
ticker.logMs("Evaluated constants");
markLibrariesUsed(constantEvaluationData.visitedLibraries);
@@ -1600,6 +1735,7 @@
ChangedStructureNotifier? get changedStructureNotifier => null;
+ // Coverage-ignore(suite): Not run.
void runProcedureTransformations(Procedure procedure) {
TypeEnvironment environment =
new TypeEnvironment(loader.coreTypes, loader.hierarchy);
@@ -1635,7 +1771,9 @@
// for legacy mode.
assert(
globalFeatures.nonNullable.isEnabled ||
+ // Coverage-ignore(suite): Not run.
loader.nnbdMode == NnbdMode.Weak,
+ // Coverage-ignore(suite): Not run.
"Non-weak nnbd mode found without experiment enabled: "
"${loader.nnbdMode}.");
return constants.EvaluationMode.fromNnbdMode(loader.nnbdMode);
@@ -1646,7 +1784,9 @@
List<LocatedMessage> errors = verifyComponent(context.options.target,
VerificationStage.afterModularTransformations, component!,
skipPlatform: context.options.skipPlatformVerification);
- assert(allowVerificationErrorForTesting || errors.isEmpty,
+ assert(
+ allowVerificationErrorForTesting || errors.isEmpty,
+ // Coverage-ignore(suite): Not run.
"Verification errors found: $errors");
ClassHierarchy hierarchy =
new ClassHierarchy(component!, new CoreTypes(component!),
@@ -1659,6 +1799,7 @@
ticker.logMs("Verified component");
}
+ // Coverage-ignore(suite): Not run.
/// Return `true` if the given [library] was built by this [KernelTarget]
/// from sources, and not loaded from a [DillTarget].
/// Note that this is meant for debugging etc and that it is slow, each
diff --git a/pkg/front_end/lib/src/kernel/kernel_variable_builder.dart b/pkg/front_end/lib/src/kernel/kernel_variable_builder.dart
index 7424251..fb4b9cc 100644
--- a/pkg/front_end/lib/src/kernel/kernel_variable_builder.dart
+++ b/pkg/front_end/lib/src/kernel/kernel_variable_builder.dart
@@ -19,6 +19,7 @@
VariableBuilderImpl(this.variable, this.fileUri);
@override
+ // Coverage-ignore(suite): Not run.
Builder? get parent => null;
@override
@@ -31,12 +32,14 @@
bool get isConst => variable.isConst;
@override
+ // Coverage-ignore(suite): Not run.
bool get isFinal => variable.isFinal;
@override
bool get isAssignable => variable.isAssignable;
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors => variable.name ?? "<unnamed>";
@override
diff --git a/pkg/front_end/lib/src/kernel/load_library_builder.dart b/pkg/front_end/lib/src/kernel/load_library_builder.dart
index 3cce3da..7f7723e 100644
--- a/pkg/front_end/lib/src/kernel/load_library_builder.dart
+++ b/pkg/front_end/lib/src/kernel/load_library_builder.dart
@@ -55,6 +55,7 @@
this._importCharOffset, this._combinators);
@override
+ // Coverage-ignore(suite): Not run.
Uri get fileUri => parent.fileUri;
LoadLibrary createLoadLibrary(
@@ -64,6 +65,7 @@
Procedure createTearoffMethod(Forest forest) {
if (tearoff != null) {
+ // Coverage-ignore-block(suite): Not run.
return tearoff!;
}
LoadLibrary expression = createLoadLibrary(charOffset, forest, null);
@@ -84,5 +86,6 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors => 'loadLibrary';
}
diff --git a/pkg/front_end/lib/src/kernel/macro/annotation_parser.dart b/pkg/front_end/lib/src/kernel/macro/annotation_parser.dart
index 0de7023..3802f295 100644
--- a/pkg/front_end/lib/src/kernel/macro/annotation_parser.dart
+++ b/pkg/front_end/lib/src/kernel/macro/annotation_parser.dart
@@ -21,6 +21,7 @@
import '../../source/source_library_builder.dart';
import 'macro.dart';
+// Coverage-ignore(suite): Not run.
List<MacroApplication>? prebuildAnnotations(
{required SourceLibraryBuilder enclosingLibrary,
required List<MetadataBuilder>? metadataBuilders,
@@ -67,6 +68,7 @@
const _UnrecognizedNode();
}
+// Coverage-ignore(suite): Not run.
class _MacroClassNode implements _Node {
final Token token;
final ClassBuilder classBuilder;
@@ -74,6 +76,7 @@
_MacroClassNode(this.token, this.classBuilder);
}
+// Coverage-ignore(suite): Not run.
class _MacroConstructorNode implements _Node {
final ClassBuilder classBuilder;
final String constructorName;
@@ -81,12 +84,14 @@
_MacroConstructorNode(this.classBuilder, this.constructorName);
}
+// Coverage-ignore(suite): Not run.
class _PrefixNode implements _Node {
final PrefixBuilder prefixBuilder;
_PrefixNode(this.prefixBuilder);
}
+// Coverage-ignore(suite): Not run.
class _MacroApplicationNode implements _Node {
final MacroApplication application;
@@ -97,6 +102,7 @@
const _NoArgumentsNode();
}
+// Coverage-ignore(suite): Not run.
class _ArgumentsNode implements _Node {
final List<macro.Argument> positionalArguments;
final Map<String, macro.Argument> namedArguments;
@@ -104,6 +110,7 @@
_ArgumentsNode(this.positionalArguments, this.namedArguments);
}
+// Coverage-ignore(suite): Not run.
class _MacroArgumentNode implements _Node {
Object? get value => argument.value;
@@ -112,18 +119,21 @@
_MacroArgumentNode(this.argument);
}
+// Coverage-ignore(suite): Not run.
class _TokenNode implements _Node {
final Token token;
_TokenNode(this.token);
}
+// Coverage-ignore(suite): Not run.
class _NamedArgumentIdentifierNode implements _Node {
final String name;
_NamedArgumentIdentifierNode(this.name);
}
+// Coverage-ignore(suite): Not run.
class _NamedArgumentNode implements _Node {
final String name;
final macro.Argument argument;
@@ -133,6 +143,7 @@
_NamedArgumentNode(this.name, this.argument);
}
+// Coverage-ignore(suite): Not run.
class _MacroListener implements Listener {
ClassBuilder? _macroClassBuilder;
diff --git a/pkg/front_end/lib/src/kernel/macro/identifiers.dart b/pkg/front_end/lib/src/kernel/macro/identifiers.dart
index 2600e3e..4a7b276 100644
--- a/pkg/front_end/lib/src/kernel/macro/identifiers.dart
+++ b/pkg/front_end/lib/src/kernel/macro/identifiers.dart
@@ -17,6 +17,7 @@
import '../../builder/type_builder.dart';
import 'introspectors.dart';
+// Coverage-ignore(suite): Not run.
abstract class IdentifierImpl extends macro.IdentifierImpl {
IdentifierImpl({
required int id,
@@ -97,6 +98,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class TypeBuilderIdentifier extends IdentifierImpl {
final TypeBuilder typeBuilder;
final LibraryBuilder libraryBuilder;
@@ -147,6 +149,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class TypeDeclarationBuilderIdentifier extends IdentifierImpl {
final TypeDeclarationBuilder typeDeclarationBuilder;
final LibraryBuilder libraryBuilder;
@@ -191,6 +194,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class MemberBuilderIdentifier extends IdentifierImpl {
final MemberBuilder memberBuilder;
@@ -232,6 +236,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class FormalParameterBuilderIdentifier extends IdentifierImpl {
final LibraryBuilder libraryBuilder;
final FormalParameterBuilder parameterBuilder;
@@ -266,6 +271,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class OmittedTypeIdentifier extends IdentifierImpl {
OmittedTypeIdentifier({required int id}) : super(id: id, name: 'dynamic');
diff --git a/pkg/front_end/lib/src/kernel/macro/introspectors.dart b/pkg/front_end/lib/src/kernel/macro/introspectors.dart
index ba7a3a6..5a050c3 100644
--- a/pkg/front_end/lib/src/kernel/macro/introspectors.dart
+++ b/pkg/front_end/lib/src/kernel/macro/introspectors.dart
@@ -25,6 +25,7 @@
import 'identifiers.dart';
import 'types.dart';
+// Coverage-ignore(suite): Not run.
class MacroIntrospection {
final SourceLoader _sourceLoader;
late final MacroTypes types = new MacroTypes(this, _sourceLoader);
@@ -666,6 +667,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _TypePhaseIntrospector implements macro.TypePhaseIntrospector {
final SourceLoader sourceLoader;
@@ -713,6 +715,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _DeclarationPhaseIntrospector extends _TypePhaseIntrospector
implements macro.DeclarationPhaseIntrospector {
final ClassHierarchyBuilder classHierarchy;
@@ -847,6 +850,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _DefinitionPhaseIntrospector extends _DeclarationPhaseIntrospector
implements macro.DefinitionPhaseIntrospector {
_DefinitionPhaseIntrospector(
diff --git a/pkg/front_end/lib/src/kernel/macro/macro.dart b/pkg/front_end/lib/src/kernel/macro/macro.dart
index 4693fc6..ffed42e 100644
--- a/pkg/front_end/lib/src/kernel/macro/macro.dart
+++ b/pkg/front_end/lib/src/kernel/macro/macro.dart
@@ -47,6 +47,7 @@
List<Map<Uri, Map<String, List<String>>>> neededPrecompilations = [];
}
+// Coverage-ignore(suite): Not run.
class MacroApplication {
final UriOffset uriOffset;
final ClassBuilder classBuilder;
@@ -115,6 +116,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class MacroApplicationDataForTesting {
Map<SourceLibraryBuilder, LibraryMacroApplicationData> libraryData = {};
Map<SourceLibraryBuilder, String> libraryTypesResult = {};
@@ -182,6 +184,7 @@
List<macro.MacroExecutionResult> definitionsResults = [];
}
+// Coverage-ignore(suite): Not run.
class ApplicationDataForTesting {
final ApplicationData applicationData;
final MacroApplication macroApplication;
@@ -216,6 +219,7 @@
Map<MemberBuilder, ApplicationData> memberApplications = {};
}
+// Coverage-ignore(suite): Not run.
/// Macro classes that need to be precompiled.
class NeededPrecompilations {
/// Map from library uris to macro class names and the names of constructor
@@ -226,6 +230,7 @@
NeededPrecompilations(this.macroDeclarations);
}
+// Coverage-ignore(suite): Not run.
void checkMacroApplications(
ClassHierarchy hierarchy,
Class macroClass,
@@ -396,6 +401,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class MacroApplications {
final SourceLoader _sourceLoader;
final macro.MacroExecutor _macroExecutor;
@@ -1262,6 +1268,7 @@
}
}
+// Coverage-ignore(suite): Not run.
macro.DeclarationKind _declarationKind(macro.Declaration declaration) {
if (declaration is macro.ConstructorDeclaration) {
return macro.DeclarationKind.constructor;
@@ -1286,6 +1293,7 @@
"Unexpected declaration ${declaration} (${declaration.runtimeType})");
}
+// Coverage-ignore(suite): Not run.
/// Data needed to apply a list of macro applications to a macro target.
abstract class ApplicationData {
final MacroIntrospection _macroIntrospection;
@@ -1304,6 +1312,7 @@
String get textForTesting;
}
+// Coverage-ignore(suite): Not run.
class LibraryApplicationData extends ApplicationData {
macro.MacroTarget? _macroTarget;
@@ -1325,6 +1334,7 @@
String get textForTesting => libraryBuilder.importUri.toString();
}
+// Coverage-ignore(suite): Not run.
/// Data needed to apply a list of macro applications to a class or member.
abstract class DeclarationApplicationData extends ApplicationData {
macro.Declaration? _declaration;
@@ -1341,6 +1351,7 @@
macro.DeclarationKind get declarationKind => _declarationKind(declaration);
}
+// Coverage-ignore(suite): Not run.
class ClassApplicationData extends DeclarationApplicationData {
final SourceClassBuilder _classBuilder;
@@ -1360,6 +1371,7 @@
String get textForTesting => _classBuilder.name;
}
+// Coverage-ignore(suite): Not run.
class ExtensionTypeApplicationData extends DeclarationApplicationData {
final SourceExtensionTypeDeclarationBuilder _extensionTypeDeclarationBuilder;
@@ -1379,6 +1391,7 @@
String get textForTesting => _extensionTypeDeclarationBuilder.name;
}
+// Coverage-ignore(suite): Not run.
class MemberApplicationData extends DeclarationApplicationData {
final MemberBuilder _memberBuilder;
@@ -1406,6 +1419,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension on macro.MacroExecutionResult {
bool get isNotEmpty =>
enumValueAugmentations.isNotEmpty ||
@@ -1470,6 +1484,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension DeclarationKindHelper on macro.DeclarationKind {
/// Returns the plural form description for the declaration kind.
String plural() => switch (this) {
diff --git a/pkg/front_end/lib/src/kernel/macro/offsets.dart b/pkg/front_end/lib/src/kernel/macro/offsets.dart
index 64a722f..0b4829f 100644
--- a/pkg/front_end/lib/src/kernel/macro/offsets.dart
+++ b/pkg/front_end/lib/src/kernel/macro/offsets.dart
@@ -6,6 +6,7 @@
import 'package:kernel/ast.dart';
+// Coverage-ignore(suite): Not run.
/// Class that maps offsets from an intermediate augmentation library to the
/// merged augmentation library.
class ReOffset {
@@ -70,6 +71,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Recursive visitor that tracks the current file URI.
abstract class FileUriVisitor extends RecursiveVisitor {
/// Called before the `FileUriNode` [node] is visited.
@@ -183,6 +185,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Visitor that replaces offsets in intermediate augmentation libraries with
/// the offsets for the merged augmentation libraries.
class ReOffsetVisitor extends FileUriVisitor {
@@ -287,6 +290,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// A range of file offset.
///
/// Used to computed the file offsets of nested ranges.
@@ -302,6 +306,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension OffsetRangeExtension on OffsetRange? {
OffsetRange include(OffsetRange range) {
OffsetRange? self = this;
diff --git a/pkg/front_end/lib/src/kernel/macro/types.dart b/pkg/front_end/lib/src/kernel/macro/types.dart
index 265aa52..ab84a53 100644
--- a/pkg/front_end/lib/src/kernel/macro/types.dart
+++ b/pkg/front_end/lib/src/kernel/macro/types.dart
@@ -21,9 +21,11 @@
import 'identifiers.dart';
import 'introspectors.dart';
+// Coverage-ignore(suite): Not run.
final IdentifierImpl omittedTypeIdentifier =
new OmittedTypeIdentifier(id: macro.RemoteInstance.uniqueId);
+// Coverage-ignore(suite): Not run.
class MacroTypes {
final MacroIntrospection _introspection;
final SourceLoader _sourceLoader;
@@ -311,6 +313,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _StaticTypeImpl extends macro.StaticTypeImpl {
final MacroTypes types;
final DartType type;
@@ -369,6 +372,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class _NamedStaticTypeImpl extends _StaticTypeImpl
implements macro.NamedStaticType {
@override
@@ -386,6 +390,7 @@
});
}
+// Coverage-ignore(suite): Not run.
// ignore: missing_override_of_must_be_overridden
class _OmittedTypeAnnotationImpl extends macro.OmittedTypeAnnotationImpl {
final OmittedTypeBuilder typeBuilder;
diff --git a/pkg/front_end/lib/src/kernel/member_covariance.dart b/pkg/front_end/lib/src/kernel/member_covariance.dart
index 96eff2aa..c594717 100644
--- a/pkg/front_end/lib/src/kernel/member_covariance.dart
+++ b/pkg/front_end/lib/src/kernel/member_covariance.dart
@@ -241,12 +241,14 @@
if (_typeParameters == null) {
typeParameters = other._typeParameters;
} else if (other._typeParameters == null) {
+ // Coverage-ignore-block(suite): Not run.
typeParameters = _typeParameters;
} else {
typeParameters = new List<bool>.filled(
max(_typeParameters.length, other._typeParameters.length), false);
for (int index = 0; index < typeParameters.length; index++) {
typeParameters[index] = isTypeParameterGenericCovariantImpl(index) ||
+ // Coverage-ignore(suite): Not run.
other.isTypeParameterGenericCovariantImpl(index);
}
}
diff --git a/pkg/front_end/lib/src/kernel/resource_identifier.dart b/pkg/front_end/lib/src/kernel/resource_identifier.dart
index 3880510..ccbc6a4 100644
--- a/pkg/front_end/lib/src/kernel/resource_identifier.dart
+++ b/pkg/front_end/lib/src/kernel/resource_identifier.dart
@@ -26,12 +26,15 @@
.where((instance) => isResourceIdentifier(instance.classNode))
.toList(growable: false);
+// Coverage-ignore(suite): Not run.
final Uri _metaLibraryUri = new Uri(scheme: 'package', path: 'meta/meta.dart');
bool isResourceIdentifier(Class classNode) =>
classNode.name == 'ResourceIdentifier' &&
+ // Coverage-ignore(suite): Not run.
classNode.enclosingLibrary.importUri == _metaLibraryUri;
+// Coverage-ignore(suite): Not run.
/// Report if the resource annotations is placed on anything but a static
/// method.
void validateResourceIdentifierDeclaration(
diff --git a/pkg/front_end/lib/src/kernel/static_weak_references.dart b/pkg/front_end/lib/src/kernel/static_weak_references.dart
index a035be7..8292ab6 100644
--- a/pkg/front_end/lib/src/kernel/static_weak_references.dart
+++ b/pkg/front_end/lib/src/kernel/static_weak_references.dart
@@ -23,6 +23,7 @@
class StaticWeakReferences {
static const String weakTearoffReferencePragma = 'weak-tearoff-reference';
+ // Coverage-ignore(suite): Not run.
static bool isWeakReference(StaticInvocation node) =>
node.target.hasWeakTearoffReferencePragma;
@@ -47,6 +48,7 @@
return false;
}
+ // Coverage-ignore(suite): Not run.
static void validateWeakReferenceUse(
StaticInvocation node, ErrorReporter errorReporter) {
final Arguments arguments = node.arguments;
@@ -76,6 +78,7 @@
.withLocation(node.location!.file, node.fileOffset, 1));
}
+ // Coverage-ignore(suite): Not run.
static void validateWeakReferenceDeclaration(
Annotatable node, ErrorReporter errorReporter) {
if (node is! Procedure ||
@@ -105,6 +108,7 @@
node.hasWeakTearoffReferencePragma = true;
}
+ // Coverage-ignore(suite): Not run.
// Returns argument expression of the weak reference.
// Assumes weak reference is valid.
static Expression getWeakReferenceArgument(StaticInvocation node) {
@@ -112,6 +116,7 @@
return node.arguments.positional.single;
}
+ // Coverage-ignore(suite): Not run.
// Returns target method of the weak reference.
// Assumes weak reference is valid.
static Procedure getWeakReferenceTarget(StaticInvocation node) {
diff --git a/pkg/front_end/lib/src/kernel/try_constant_evaluator.dart b/pkg/front_end/lib/src/kernel/try_constant_evaluator.dart
index d7a8330..a60c95c 100644
--- a/pkg/front_end/lib/src/kernel/try_constant_evaluator.dart
+++ b/pkg/front_end/lib/src/kernel/try_constant_evaluator.dart
@@ -48,6 +48,7 @@
enableTripleShift: true);
@override
+ // Coverage-ignore(suite): Not run.
Constant evaluate(StaticTypeContext staticTypeContext, Expression node,
{TreeNode? contextNode}) {
return evaluateOrNull(staticTypeContext, node, contextNode: contextNode)!;
@@ -62,6 +63,7 @@
{TreeNode? contextNode, bool requireConstant = true}) {
errorReporter.requiresConstant = requireConstant;
if (node is ConstantExpression) {
+ // Coverage-ignore-block(suite): Not run.
Constant constant = node.constant;
// TODO(fishythefish): Add more control over what to do with
// [UnevaluatedConstant]s.
@@ -80,6 +82,7 @@
return constant;
}
if (requireConstant) {
+ // Coverage-ignore-block(suite): Not run.
return super.evaluate(staticTypeContext, node, contextNode: contextNode);
} else {
Constant constant =
@@ -102,11 +105,13 @@
@override
void report(LocatedMessage message, [List<LocatedMessage>? context]) {
if (requiresConstant) {
+ // Coverage-ignore-block(suite): Not run.
_reportError(message, context);
}
}
}
+// Coverage-ignore(suite): Not run.
/// [Constant] visitor that returns `true` if the visitor constant contains
/// an [UnevaluatedConstant].
class UnevaluatedConstantFinder extends ComputeOnceConstantVisitor<bool> {
diff --git a/pkg/front_end/lib/src/kernel/type_algorithms.dart b/pkg/front_end/lib/src/kernel/type_algorithms.dart
index 70177f7..edd51ec 100644
--- a/pkg/front_end/lib/src/kernel/type_algorithms.dart
+++ b/pkg/front_end/lib/src/kernel/type_algorithms.dart
@@ -127,6 +127,7 @@
case ExtensionBuilder():
case InvalidTypeDeclarationBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -376,15 +377,19 @@
newArguments[i] = substitutedArgument;
}
}
+ // Coverage-ignore(suite): Not run.
case NominalVariableBuilder():
// Handled above.
throw new UnsupportedError("Unexpected NominalVariableBuilder");
+ // Coverage-ignore(suite): Not run.
case StructuralVariableBuilder():
// Handled above.
throw new UnsupportedError("Unexpected StructuralVariableBuilder");
+ // Coverage-ignore(suite): Not run.
case InvalidTypeDeclarationBuilder():
// Don't substitute.
break;
+ // Coverage-ignore(suite): Not run.
case ExtensionBuilder():
case BuiltinTypeDeclarationBuilder():
// TODO(johnniwinther): How should we handle this case?
@@ -748,12 +753,17 @@
}
break;
case FunctionTypeBuilder(
+ // Coverage-ignore(suite): Not run.
:List<StructuralVariableBuilder>? typeVariables,
+ // Coverage-ignore(suite): Not run.
:List<ParameterBuilder>? formals,
+ // Coverage-ignore(suite): Not run.
:TypeBuilder returnType
):
+ // Coverage-ignore(suite): Not run.
uses.addAll(findVariableUsesInType(variable, returnType));
if (typeVariables != null) {
+ // Coverage-ignore-block(suite): Not run.
for (StructuralVariableBuilder dependentVariable in typeVariables) {
if (dependentVariable.bound != null) {
uses.addAll(
@@ -766,6 +776,7 @@
}
}
if (formals != null) {
+ // Coverage-ignore-block(suite): Not run.
for (ParameterBuilder formal in formals) {
uses.addAll(findVariableUsesInType(variable, formal.type));
}
@@ -780,6 +791,7 @@
}
}
if (namedFields != null) {
+ // Coverage-ignore-block(suite): Not run.
for (RecordTypeFieldBuilder field in namedFields) {
uses.addAll(findVariableUsesInType(variable, field.type));
}
@@ -868,6 +880,7 @@
}
}
if (hasInbound) {
+ // Coverage-ignore-block(suite): Not run.
typesAndDependencies.add(type);
typesAndDependencies.add(const <Object>[]);
}
@@ -887,6 +900,7 @@
List<Object> dependencies =
findInboundReferences(type.typeVariables!);
if (dependencies.length != 0) {
+ // Coverage-ignore-block(suite): Not run.
typesAndDependencies.add(type);
typesAndDependencies.add(dependencies);
}
@@ -898,6 +912,7 @@
List<Object> dependencies =
findInboundReferences(declaration.typeParameters!);
if (dependencies.length != 0) {
+ // Coverage-ignore-block(suite): Not run.
typesAndDependencies.add(type);
typesAndDependencies.add(dependencies);
}
@@ -907,6 +922,7 @@
case ExtensionBuilder():
case InvalidTypeDeclarationBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -931,6 +947,7 @@
.addAll(findRawTypesWithInboundReferences(variable.bound));
}
if (variable.defaultType != null) {
+ // Coverage-ignore-block(suite): Not run.
typesAndDependencies.addAll(
findRawTypesWithInboundReferences(variable.defaultType));
}
@@ -1094,6 +1111,7 @@
visitTypeVariables(type.typeVariables);
}
case ExtensionBuilder():
+ // Coverage-ignore(suite): Not run.
visitTypeVariables(declaration.typeParameters);
case ExtensionTypeDeclarationBuilder():
visitTypeVariables(declaration.typeParameters);
@@ -1110,6 +1128,7 @@
case BuiltinTypeDeclarationBuilder():
// Do nothing.
break;
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
@@ -1136,6 +1155,7 @@
findRawTypePathsToDeclaration(variable.bound, end, visited));
}
if (variable.defaultType != null) {
+ // Coverage-ignore-block(suite): Not run.
paths.addAll(findRawTypePathsToDeclaration(
variable.defaultType, end, visited));
}
@@ -1492,5 +1512,6 @@
RawTypeCycleElement(this.type, this.typeVariable)
: assert(typeVariable is NominalVariableBuilder? ||
+ // Coverage-ignore(suite): Not run.
typeVariable is StructuralVariableBuilder?);
}
diff --git a/pkg/front_end/lib/src/kernel/type_builder_computer.dart b/pkg/front_end/lib/src/kernel/type_builder_computer.dart
index 58b5a1a..a2d2344 100644
--- a/pkg/front_end/lib/src/kernel/type_builder_computer.dart
+++ b/pkg/front_end/lib/src/kernel/type_builder_computer.dart
@@ -101,6 +101,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder visitNeverType(NeverType node,
Map<TypeParameter, NominalVariableBuilder> pendingNominalVariables) {
return new NamedTypeBuilderImpl.forDartType(node, neverDeclaration,
@@ -150,6 +151,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder visitFutureOrType(FutureOrType node,
Map<TypeParameter, NominalVariableBuilder> pendingNominalVariables) {
TypeBuilder argument =
@@ -244,12 +246,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder visitIntersectionType(IntersectionType node,
Map<TypeParameter, NominalVariableBuilder> pendingNominalVariables) {
throw "Not implemented";
}
@override
+ // Coverage-ignore(suite): Not run.
TypeBuilder visitTypedefType(TypedefType node,
Map<TypeParameter, NominalVariableBuilder> pendingNominalVariables) {
throw "Not implemented";
diff --git a/pkg/front_end/lib/src/kernel/utils.dart b/pkg/front_end/lib/src/kernel/utils.dart
index c9bd4b2..24b0d94 100644
--- a/pkg/front_end/lib/src/kernel/utils.dart
+++ b/pkg/front_end/lib/src/kernel/utils.dart
@@ -45,6 +45,7 @@
/// 'Never' from 'dart:core'.
const String exportNeverSentinel = '<Never>';
+// Coverage-ignore(suite): Not run.
void printNodeOn(Node? node, StringSink sink, {NameSystem? syntheticNames}) {
if (node == null) {
sink.write("null");
@@ -54,6 +55,7 @@
}
}
+// Coverage-ignore(suite): Not run.
void printQualifiedNameOn(Member? member, StringSink sink) {
if (member == null) {
sink.write("null");
@@ -69,6 +71,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Print the given [component]. Do nothing if it is `null`. If the
/// [libraryFilter] is provided, then only libraries that satisfy it are
/// printed.
@@ -86,6 +89,7 @@
print(sb);
}
+// Coverage-ignore(suite): Not run.
/// Write [component] to file only including libraries that match [filter].
Future<Null> writeComponentToFile(Component component, Uri uri,
{bool Function(Library library)? filter}) async {
@@ -99,6 +103,7 @@
}
}
+// Coverage-ignore(suite): Not run.
/// Serialize the libraries in [component] that match [filter].
Uint8List serializeComponent(Component component,
{bool Function(Library library)? filter,
@@ -115,6 +120,7 @@
const String kDebugClassName = "#DebugClass";
+// Coverage-ignore(suite): Not run.
class _CollectLibraryDependencies extends RecursiveVisitor {
Set<LibraryDependency> foundLibraryDependencies = {};
@@ -129,6 +135,7 @@
}
}
+// Coverage-ignore(suite): Not run.
Component createExpressionEvaluationComponent(Procedure procedure) {
Library realLibrary = procedure.enclosingLibrary;
@@ -195,6 +202,7 @@
return component;
}
+// Coverage-ignore(suite): Not run.
List<int> serializeProcedure(Procedure procedure) {
return serializeComponent(createExpressionEvaluationComponent(procedure));
}
@@ -209,6 +217,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void close() {}
}
diff --git a/pkg/front_end/lib/src/kernel/verifier.dart b/pkg/front_end/lib/src/kernel/verifier.dart
index 4d9c1e5..d2027eb 100644
--- a/pkg/front_end/lib/src/kernel/verifier.dart
+++ b/pkg/front_end/lib/src/kernel/verifier.dart
@@ -33,6 +33,7 @@
return listener.errors;
}
+// Coverage-ignore(suite): Not run.
class FastaVerificationErrorListener implements VerificationErrorListener {
List<LocatedMessage> errors = [];
diff --git a/pkg/front_end/lib/src/kernel_generator_impl.dart b/pkg/front_end/lib/src/kernel_generator_impl.dart
index 54ffb8a..a84e03d 100644
--- a/pkg/front_end/lib/src/kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/kernel_generator_impl.dart
@@ -38,6 +38,7 @@
show MacroConfiguration, computeMacroConfiguration;
import 'source/source_loader.dart' show SourceLoader;
+// Coverage-ignore(suite): Not run.
/// Implementation for the
/// `package:front_end/src/api_prototype/kernel_generator.dart` and
/// `package:front_end/src/api_prototype/summary_generator.dart` APIs.
@@ -102,6 +103,7 @@
dillTarget.loader.appendLibraries(additionalDill);
}
} else if (options.hasAdditionalDills) {
+ // Coverage-ignore-block(suite): Not run.
nameRoot = sdkSummary?.root ?? new CanonicalName.root();
for (Component additionalDill
in await options.loadAdditionalDills(nameRoot)) {
@@ -119,15 +121,19 @@
kernelTarget.setEntryPoints(options.inputs);
NeededPrecompilations? neededPrecompilations =
await kernelTarget.computeNeededPrecompilations();
- kernelTarget.benchmarker?.enterPhase(BenchmarkPhases.precompileMacros);
+ kernelTarget.benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.enterPhase(BenchmarkPhases.precompileMacros);
Map<Uri, ExecutorFactoryToken>? precompiled =
await precompileMacros(neededPrecompilations, options);
if (precompiled != null) {
+ // Coverage-ignore-block(suite): Not run.
kernelTarget.benchmarker
?.enterPhase(BenchmarkPhases.unknownGenerateKernelInternal);
continue;
}
kernelTarget.benchmarker
+ // Coverage-ignore(suite): Not run.
?.enterPhase(BenchmarkPhases.unknownGenerateKernelInternal);
return _buildInternal(
options: options,
@@ -144,6 +150,7 @@
retainDataForTesting: retainDataForTesting);
}
},
+ // Coverage-ignore(suite): Not run.
() =>
sourceLoader?.currentUriForCrashReporting ??
new UriOffset(options.inputs.first, TreeNode.noOffset));
@@ -167,6 +174,7 @@
Component summaryComponent = buildResult.component!;
List<int>? summary = null;
if (buildSummary) {
+ // Coverage-ignore-block(suite): Not run.
if (options.verify) {
List<LocatedMessage> errors = verifyComponent(
options.target, VerificationStage.outline, summaryComponent);
@@ -233,6 +241,7 @@
verify: options.verify);
component = buildResult.component;
if (options.debugDump) {
+ // Coverage-ignore-block(suite): Not run.
printComponentText(component,
libraryFilter: kernelTarget.isSourceLibraryForDebugging,
showOffsets: options.debugDumpShowOffsets);
@@ -243,7 +252,9 @@
}
// TODO(johnniwinther): Should we reuse the macro executor on subsequent
// compilations where possible?
- buildResult.macroApplications?.close();
+ buildResult.macroApplications
+ // Coverage-ignore(suite): Not run.
+ ?.close();
return new InternalCompilerResult(
summary: summary,
@@ -303,6 +314,7 @@
this.kernelTargetForTesting});
}
+// Coverage-ignore(suite): Not run.
/// A fake absolute directory used as the root of a memory-file system in the
/// compilation below.
final Uri _defaultDir = Uri.parse('org-dartlang-macro:///a/b/c/');
@@ -318,6 +330,7 @@
Future<Map<Uri, ExecutorFactoryToken>?> precompileMacros(
NeededPrecompilations? neededPrecompilations,
ProcessedOptions options) async {
+ // Coverage-ignore-block(suite): Not run.
if (neededPrecompilations != null) {
if (options.globalFeatures.macros.isEnabled) {
// TODO(johnniwinther): Avoid using [rawOptionsForTesting] to compute
@@ -336,6 +349,7 @@
return null;
}
+// Coverage-ignore(suite): Not run.
Future<Map<Uri, ExecutorFactoryToken>?> _compileMacros(
NeededPrecompilations neededPrecompilations,
ProcessedOptions options) async {
diff --git a/pkg/front_end/lib/src/macros/isolate_macro_serializer.dart b/pkg/front_end/lib/src/macros/isolate_macro_serializer.dart
index 2788ad6..db5718f 100644
--- a/pkg/front_end/lib/src/macros/isolate_macro_serializer.dart
+++ b/pkg/front_end/lib/src/macros/isolate_macro_serializer.dart
@@ -8,6 +8,7 @@
import 'macro_serializer.dart';
+// Coverage-ignore(suite): Not run.
/// [MacroSerializer] that uses blobs registered with the current [Isolate] to
/// give access to precompiled macro [Component]s.
///
diff --git a/pkg/front_end/lib/src/macros/macro_serializer.dart b/pkg/front_end/lib/src/macros/macro_serializer.dart
index 68425ea..da10ae0 100644
--- a/pkg/front_end/lib/src/macros/macro_serializer.dart
+++ b/pkg/front_end/lib/src/macros/macro_serializer.dart
@@ -8,6 +8,7 @@
import 'isolate_macro_serializer.dart';
import 'temp_dir_macro_serializer.dart';
+// Coverage-ignore(suite): Not run.
/// Interface for supporting serialization of [Component]s for macro
/// precompilation.
abstract class MacroSerializer {
diff --git a/pkg/front_end/lib/src/macros/macro_target.dart b/pkg/front_end/lib/src/macros/macro_target.dart
index aea3fd0..3e31eed 100644
--- a/pkg/front_end/lib/src/macros/macro_target.dart
+++ b/pkg/front_end/lib/src/macros/macro_target.dart
@@ -7,9 +7,11 @@
import 'macro_target_unsupported.dart'
if (dart.library.io) 'macro_target_io.dart' as impl;
+// Coverage-ignore(suite): Not run.
MacroConfiguration computeMacroConfiguration({Uri? targetSdkSummary}) =>
impl.computeMacroConfiguration(targetSdkSummary: targetSdkSummary);
+// Coverage-ignore(suite): Not run.
class MacroConfiguration {
final Target target;
final Uri? sdkSummary;
diff --git a/pkg/front_end/lib/src/macros/macro_target_io.dart b/pkg/front_end/lib/src/macros/macro_target_io.dart
index 66920e7..c231c82 100644
--- a/pkg/front_end/lib/src/macros/macro_target_io.dart
+++ b/pkg/front_end/lib/src/macros/macro_target_io.dart
@@ -9,6 +9,7 @@
import 'macro_target.dart';
+// Coverage-ignore(suite): Not run.
MacroConfiguration computeMacroConfiguration({Uri? targetSdkSummary}) {
// Force the SDK summary to "vm_platform_strong.dill".
// TODO(54404): make this sufficiently correct for all use cases.
@@ -19,6 +20,7 @@
sdkSummary: _findSdkSummary(targetSdkSummary: targetSdkSummary));
}
+// Coverage-ignore(suite): Not run.
Uri _findSdkSummary({Uri? targetSdkSummary}) {
if (targetSdkSummary?.path == 'virtual_platform_kernel.dill') {
return targetSdkSummary!;
@@ -55,6 +57,7 @@
throw new StateError('Unable to find platform dill to build macros.');
}
+// Coverage-ignore(suite): Not run.
// Looks for a directory `dart-sdk` in or above [directory].
Directory? _findSdkDirectoryAbove(Directory directory) {
while (directory.parent.path != directory.path) {
@@ -66,6 +69,7 @@
return null;
}
+// Coverage-ignore(suite): Not run.
// Returns the `vm_platform_strong.dill` file under [sdkDirectory] if it
// exists, or `null` if not.
File? _findPlatformDillUnder(Directory sdkDirectory) {
diff --git a/pkg/front_end/lib/src/macros/temp_dir_macro_serializer.dart b/pkg/front_end/lib/src/macros/temp_dir_macro_serializer.dart
index ad800ae..27580f9 100644
--- a/pkg/front_end/lib/src/macros/temp_dir_macro_serializer.dart
+++ b/pkg/front_end/lib/src/macros/temp_dir_macro_serializer.dart
@@ -10,6 +10,7 @@
import '../kernel/utils.dart';
import 'macro_serializer.dart';
+// Coverage-ignore(suite): Not run.
/// [MacroSerializer] that uses .dill files stored in a temporary directory to
/// provided [Uri]s for precompiled macro [Component]s.
///
diff --git a/pkg/front_end/lib/src/source/class_declaration.dart b/pkg/front_end/lib/src/source/class_declaration.dart
index f1f0078..4fb9107 100644
--- a/pkg/front_end/lib/src/source/class_declaration.dart
+++ b/pkg/front_end/lib/src/source/class_declaration.dart
@@ -237,6 +237,7 @@
includeDuplicates: includeDuplicates);
}
+ // Coverage-ignore(suite): Not run.
factory ClassDeclarationMemberIterator.local(D classBuilder,
{required bool includeDuplicates}) {
return new ClassDeclarationMemberIterator._(classBuilder, null,
@@ -274,9 +275,12 @@
}
@override
- T get current => _iterator?.current ?? (throw new StateError('No element'));
+ T get current =>
+ _iterator?.current ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
+// Coverage-ignore(suite): Not run.
class ClassDeclarationMemberNameIterator<D extends ClassDeclaration,
T extends Builder> implements NameIterator<T> {
NameIterator<T>? _iterator;
@@ -344,6 +348,7 @@
includeDuplicates: includeDuplicates);
}
+ // Coverage-ignore(suite): Not run.
factory ClassDeclarationConstructorIterator.local(D classBuilder,
{required bool includeDuplicates}) {
return new ClassDeclarationConstructorIterator._(classBuilder, null,
@@ -382,7 +387,9 @@
}
@override
- T get current => _iterator?.current ?? (throw new StateError('No element'));
+ T get current =>
+ _iterator?.current ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
class ClassDeclarationConstructorNameIterator<D extends ClassDeclaration,
@@ -432,8 +439,12 @@
}
@override
- T get current => _iterator?.current ?? (throw new StateError('No element'));
+ T get current =>
+ _iterator?.current ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
@override
- String get name => _iterator?.name ?? (throw new StateError('No element'));
+ String get name =>
+ _iterator?.name ?? // Coverage-ignore(suite): Not run.
+ (throw new StateError('No element'));
}
diff --git a/pkg/front_end/lib/src/source/diet_listener.dart b/pkg/front_end/lib/src/source/diet_listener.dart
index 0151481..57e271e 100644
--- a/pkg/front_end/lib/src/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/source/diet_listener.dart
@@ -195,6 +195,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNamedRecordField(Token colon) {
debugEvent("NamedRecordField");
pop(); // Named record field name.
@@ -236,6 +237,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleInvalidTypeArguments(Token token) {
debugEvent("InvalidTypeArguments");
}
@@ -262,7 +264,9 @@
assert(count == 0); // Count is always 0 as the diet parser skips formals.
if (kind != MemberKind.GeneralizedFunctionType &&
identical(peek(), "-") &&
+ // Coverage-ignore(suite): Not run.
identical(beginToken.next, endToken)) {
+ // Coverage-ignore-block(suite): Not run.
pop();
push("unary-");
}
@@ -273,6 +277,7 @@
void handleNoFormalParameters(Token token, MemberKind kind) {
debugEvent("NoFormalParameters");
if (identical(peek(), "-")) {
+ // Coverage-ignore-block(suite): Not run.
pop();
push("unary-");
}
@@ -437,6 +442,7 @@
Object? suffix = pop();
Object? prefix = pop();
if (prefix is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(prefix);
} else if (suffix is ParserRecovery) {
push(suffix);
@@ -457,6 +463,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void endLibraryAugmentation(
Token augmentKeyword, Token libraryKeyword, Token semicolon) {
debugEvent("endLibraryAugmentation");
@@ -492,6 +499,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleStringJuxtaposition(Token startToken, int literalCount) {
debugEvent("StringJuxtaposition");
}
@@ -519,6 +527,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleInvalidOperatorName(Token operatorKeyword, Token token) {
debugEvent("InvalidOperatorName");
push(new SimpleIdentifier(token));
@@ -705,11 +714,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNativeFunctionBody(Token nativeToken, Token semicolon) {
debugEvent("NativeFunctionBody");
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNativeFunctionBodyIgnored(Token nativeToken, Token semicolon) {
debugEvent("NativeFunctionBodyIgnored");
}
@@ -783,6 +794,7 @@
Builder? memberBuilder = _offsetMap.lookupProcedure(identifier);
if (currentClass?.isEnum == true &&
memberBuilder is SourceFieldBuilder &&
+ // Coverage-ignore(suite): Not run.
memberBuilder.name == "values") {
// This is the case of a method with the name 'values' declared in an
// Enum. In that case the method is replaced with the synthesized field
@@ -820,6 +832,7 @@
Scope? formalParameterScope,
InferenceDataForTesting? inferenceDataForTesting}) {
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.beginSubdivide(BenchmarkSubdivides.diet_listener_createListener);
// Note: we set thisType regardless of whether we are building a static
// member, since that provides better error recovery.
@@ -838,7 +851,9 @@
thisTypeParameters,
typeInferrer,
constantContext);
- _benchmarker?.endSubdivide();
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
return result;
}
@@ -881,13 +896,18 @@
thisVariable: builder.thisVariable,
thisTypeParameters: builder.thisTypeParameters,
formalParameterScope: formalParameterScope,
- inferenceDataForTesting: builder.dataForTesting?.inferenceData);
+ inferenceDataForTesting: builder
+ .dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.inferenceData);
}
void buildRedirectingFactoryMethod(Token token, SourceFunctionBuilder builder,
MemberKind kind, Token? metadata) {
- _benchmarker?.beginSubdivide(
- BenchmarkSubdivides.diet_listener_buildRedirectingFactoryMethod);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.beginSubdivide(
+ BenchmarkSubdivides.diet_listener_buildRedirectingFactoryMethod);
final BodyBuilder listener = createFunctionListener(builder,
inOutlineBuildingPhase: false, inMetadata: false, inConstFields: false);
try {
@@ -904,19 +924,25 @@
listener.pop(); // Pops formal parameters.
listener.finishRedirectingFactoryBody();
listener.checkEmpty(token.next!.charOffset);
- } on DebugAbort {
+ }
+ // Coverage-ignore(suite): Not run.
+ on DebugAbort {
rethrow;
} catch (e, s) {
throw new Crash(uri, token.charOffset, e, s);
}
- _benchmarker?.endSubdivide();
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
}
void buildFields(int count, Token token, bool isTopLevel) {
assert(checkState(
token, repeatedKind(ValueKinds.IdentifierOrParserRecovery, count)));
- _benchmarker?.beginSubdivide(BenchmarkSubdivides.diet_listener_buildFields);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.beginSubdivide(BenchmarkSubdivides.diet_listener_buildFields);
List<Identifier?>? names =
const FixedNullableList<Identifier>().pop(stack, count);
Token? metadata = pop() as Token?;
@@ -934,12 +960,17 @@
inMetadata: false,
inConstFields: declaration.isConst),
memberScope,
- inferenceDataForTesting: declaration.dataForTesting?.inferenceData),
+ inferenceDataForTesting: declaration
+ .dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.inferenceData),
token,
metadata,
isTopLevel);
checkEmpty(token.charOffset);
- _benchmarker?.endSubdivide();
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
}
@override
@@ -976,6 +1007,7 @@
assert(currentDeclaration == null);
assert(memberScope == libraryBuilder.scope);
if (name is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
currentClassIsParserRecovery = true;
return;
}
@@ -1225,8 +1257,10 @@
listener.pop() as AsyncMarker?;
void buildPrimaryConstructor(BodyBuilder bodyBuilder, Token startToken) {
- _benchmarker?.beginSubdivide(
- BenchmarkSubdivides.diet_listener_buildPrimaryConstructor);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.beginSubdivide(
+ BenchmarkSubdivides.diet_listener_buildPrimaryConstructor);
Token token = startToken;
try {
Parser parser = new Parser(bodyBuilder,
@@ -1239,8 +1273,12 @@
bodyBuilder.handleNoInitializers();
bodyBuilder.checkEmpty(token.charOffset);
bodyBuilder.finishFunction(formals, AsyncMarker.Sync, null);
- _benchmarker?.endSubdivide();
- } on DebugAbort {
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
+ }
+ // Coverage-ignore(suite): Not run.
+ on DebugAbort {
rethrow;
} catch (e, s) {
throw new Crash(uri, token.charOffset, e, s);
@@ -1250,6 +1288,7 @@
void buildFunctionBody(BodyBuilder bodyBuilder, Token startToken,
Token? metadata, MemberKind kind) {
_benchmarker
+ // Coverage-ignore(suite): Not run.
?.beginSubdivide(BenchmarkSubdivides.diet_listener_buildFunctionBody);
Token token = startToken;
try {
@@ -1276,15 +1315,23 @@
bool isExpression = false;
bool allowAbstract = asyncModifier == AsyncMarker.Sync;
- _benchmarker?.beginSubdivide(BenchmarkSubdivides
- .diet_listener_buildFunctionBody_parseFunctionBody);
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.beginSubdivide(BenchmarkSubdivides
+ .diet_listener_buildFunctionBody_parseFunctionBody);
parser.parseFunctionBody(token, isExpression, allowAbstract);
Statement? body = bodyBuilder.pop() as Statement?;
- _benchmarker?.endSubdivide();
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
bodyBuilder.checkEmpty(token.charOffset);
bodyBuilder.finishFunction(formals, asyncModifier, body);
- _benchmarker?.endSubdivide();
- } on DebugAbort {
+ _benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
+ }
+ // Coverage-ignore(suite): Not run.
+ on DebugAbort {
rethrow;
} catch (e, s) {
throw new Crash(uri, token.charOffset, e, s);
diff --git a/pkg/front_end/lib/src/source/name_scheme.dart b/pkg/front_end/lib/src/source/name_scheme.dart
index a2740b5..1e12b50 100644
--- a/pkg/front_end/lib/src/source/name_scheme.dart
+++ b/pkg/front_end/lib/src/source/name_scheme.dart
@@ -62,9 +62,13 @@
required ContainerName? containerName,
required ContainerType containerType,
bool isSynthesized = false}) {
- assert(isSynthesized || fieldNameType == FieldNameType.Field,
+ assert(
+ isSynthesized || fieldNameType == FieldNameType.Field,
+ // Coverage-ignore(suite): Not run.
"Unexpected field name type for non-synthesized field: $fieldNameType");
- assert((containerName == null) == (containerType == ContainerType.Library),
+ assert(
+ (containerName == null) == (containerType == ContainerType.Library),
+ // Coverage-ignore(suite): Not run.
"Missing container name for ${containerType}");
String baseName;
@@ -117,12 +121,14 @@
return new ExtensionProcedureName(
libraryName, containerName!, containerType, kind, name,
isStatic: isStatic);
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
throw new UnsupportedError('Unexpected procedure kind ${kind}');
}
}
}
+ // Coverage-ignore(suite): Not run.
static String createProcedureNameForTesting(
{required ContainerName? containerName,
required ContainerType containerType,
@@ -162,12 +168,14 @@
case ProcedureKind.Operator:
kindInfix = '';
break;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
throw new UnsupportedError(
'Unexpected extension method kind ${kind}');
}
}
return '${extensionName}|${kindInfix}${name}';
+ // Coverage-ignore(suite): Not run.
case ContainerType.Library:
case ContainerType.Class:
return name;
@@ -358,7 +366,9 @@
factory MemberName(LibraryName libraryName, String text) =>
text.startsWith('_')
? new PrivateMemberName(libraryName, text)
- : new PublicMemberName(text);
+ :
+ // Coverage-ignore(suite): Not run.
+ new PublicMemberName(text);
/// Returns the current [Name] for this member name.
Name get name;
@@ -387,6 +397,7 @@
name = new Name(text);
@override
+ // Coverage-ignore(suite): Not run.
void updateMemberName() {}
@override
diff --git a/pkg/front_end/lib/src/source/offset_map.dart b/pkg/front_end/lib/src/source/offset_map.dart
index 9bbacd34..ded97e8 100644
--- a/pkg/front_end/lib/src/source/offset_map.dart
+++ b/pkg/front_end/lib/src/source/offset_map.dart
@@ -32,26 +32,34 @@
OffsetMap(this.uri);
void registerImport(Token importKeyword, Import import) {
- assert(importKeyword.lexeme == 'import',
+ assert(
+ importKeyword.lexeme == 'import',
+ // Coverage-ignore(suite): Not run.
"Invalid token for import: $importKeyword.");
_imports[importKeyword.charOffset] = import;
}
Import lookupImport(Token importKeyword) {
- assert(importKeyword.lexeme == 'import',
+ assert(
+ importKeyword.lexeme == 'import',
+ // Coverage-ignore(suite): Not run.
"Invalid token for import: $importKeyword.");
return _checkDirective(_imports[importKeyword.charOffset], '<import>',
importKeyword.charOffset);
}
void registerExport(Token exportKeyword, Export export) {
- assert(exportKeyword.lexeme == 'export',
+ assert(
+ exportKeyword.lexeme == 'export',
+ // Coverage-ignore(suite): Not run.
"Invalid token for export: $exportKeyword.");
_exports[exportKeyword.charOffset] = export;
}
Export lookupExport(Token exportKeyword) {
- assert(exportKeyword.lexeme == 'export',
+ assert(
+ exportKeyword.lexeme == 'export',
+ // Coverage-ignore(suite): Not run.
"Invalid token for export: $exportKeyword.");
return _checkDirective(_exports[exportKeyword.charOffset], '<export>',
exportKeyword.charOffset);
@@ -59,13 +67,15 @@
void registerPart(Token partKeyword, LibraryPart part) {
assert(
- partKeyword.lexeme == 'part', "Invalid token for part: $partKeyword.");
+ partKeyword.lexeme == 'part', // Coverage-ignore(suite): Not run.
+ "Invalid token for part: $partKeyword.");
_parts[partKeyword.charOffset] = part;
}
LibraryPart lookupPart(Token partKeyword) {
assert(
- partKeyword.lexeme == 'part', "Invalid token for part: $partKeyword.");
+ partKeyword.lexeme == 'part', // Coverage-ignore(suite): Not run.
+ "Invalid token for part: $partKeyword.");
return _checkDirective(
_parts[partKeyword.charOffset], '<part>', partKeyword.charOffset);
}
diff --git a/pkg/front_end/lib/src/source/outline_builder.dart b/pkg/front_end/lib/src/source/outline_builder.dart
index 7c573d6..5f2e227 100644
--- a/pkg/front_end/lib/src/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/source/outline_builder.dart
@@ -567,6 +567,7 @@
void popDeclarationContext([DeclarationContext? expectedContext]) {
assert(
expectedContext == null || expectedContext == declarationContext,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration context: "
"Expected $expectedContext, actual $declarationContext.");
_declarationContext = _declarationContext.tail!;
@@ -649,6 +650,7 @@
Object? names = pop();
if (names is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(names);
} else {
push(new CombinatorBuilder.hide(names as Iterable<String>,
@@ -661,6 +663,7 @@
debugEvent("Show");
Object? names = pop();
if (names is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(names);
} else {
push(new CombinatorBuilder.show(names as Iterable<String>,
@@ -736,7 +739,9 @@
pop(NullValues.Metadata) as List<MetadataBuilder>?;
checkEmpty(importKeyword.charOffset);
if (prefix is! Identifier?) {
- assert(prefix is ParserRecovery,
+ assert(
+ prefix is ParserRecovery,
+ // Coverage-ignore(suite): Not run.
"Unexpected prefix $prefix (${prefix.runtimeType}).");
return;
}
@@ -778,11 +783,13 @@
int charOffset = popCharOffset();
String uri = pop() as String;
if (equalSign != null) {
+ // Coverage-ignore-block(suite): Not run.
popCharOffset();
}
String condition = popIfNotNull(equalSign) as String? ?? "true";
Object? dottedName = pop();
if (dottedName is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
push(dottedName);
} else {
push(new Configuration(charOffset, dottedName as String, condition, uri));
@@ -797,6 +804,7 @@
List<String>? names = popIdentifierList(count);
if (names == null) {
+ // Coverage-ignore-block(suite): Not run.
push(new ParserRecovery(firstIdentifier.charOffset));
} else {
push(names.join('.'));
@@ -842,6 +850,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleInvalidOperatorName(Token operatorKeyword, Token token) {
debugEvent("handleInvalidOperatorName");
push(new SimpleIdentifier(token));
@@ -904,6 +913,7 @@
pop(); // Char offset.
Object? name = pop();
if (name is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
nativeMethodName = '';
} else {
nativeMethodName = name as String; // String.
@@ -914,6 +924,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleStringJuxtaposition(Token startToken, int literalCount) {
debugEvent("StringJuxtaposition");
List<String> list =
@@ -933,6 +944,7 @@
assert(checkState(
null, repeatedKind(ValueKinds.IdentifierOrParserRecovery, count)));
push(popIdentifierList(count) ??
+ // Coverage-ignore(suite): Not run.
(count == 0 ? NullValues.IdentifierList : new ParserRecovery(-1)));
}
@@ -946,11 +958,14 @@
Object? suffix = pop();
Object prefix = pop()!;
if (prefix is! Identifier) {
+ // Coverage-ignore-block(suite): Not run.
assert(prefix is ParserRecovery,
"Unexpected prefix $prefix (${prefix.runtimeType})");
push(prefix);
} else if (suffix is! Identifier) {
- assert(suffix is ParserRecovery,
+ assert(
+ suffix is ParserRecovery,
+ // Coverage-ignore(suite): Not run.
"Unexpected suffix $suffix (${suffix.runtimeType})");
push(suffix);
} else {
@@ -981,6 +996,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void endLibraryAugmentation(
Token augmentKeyword, Token libraryKeyword, Token semicolon) {
debugEvent("endLibraryAugmentation");
@@ -1105,6 +1121,7 @@
DeclarationContext declarationContext;
switch (kind) {
case DeclarationKind.TopLevel:
+ // Coverage-ignore(suite): Not run.
throw new UnsupportedError('Unexpected top level body.');
case DeclarationKind.Class:
declarationContext = DeclarationContext.ClassBody;
@@ -1118,6 +1135,7 @@
case DeclarationKind.ExtensionType:
declarationContext = DeclarationContext.ExtensionTypeBody;
break;
+ // Coverage-ignore(suite): Not run.
case DeclarationKind.Enum:
declarationContext = DeclarationContext.Enum;
break;
@@ -1333,6 +1351,7 @@
inAbstractOrSealedClass = false;
checkEmpty(beginToken.charOffset);
if (name is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
_builderFactory
.endNestedDeclaration(
TypeParameterScopeKind.classDeclaration, "<syntax-error>")
@@ -1440,14 +1459,18 @@
pop(NullValues.Metadata) as List<MetadataBuilder>?;
checkEmpty(beginToken.charOffset);
if (name is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
_builderFactory
.endNestedDeclaration(
TypeParameterScopeKind.mixinDeclaration, "<syntax-error>")
.resolveNamedTypes(typeVariables, _problemReporting);
} else {
Identifier identifier = name as Identifier;
- int startOffset =
- metadata == null ? beginToken.charOffset : metadata.first.charOffset;
+ int startOffset = metadata == null
+ ? beginToken.charOffset
+ :
+ // Coverage-ignore(suite): Not run.
+ metadata.first.charOffset;
String classNameForErrors = identifier.name;
if (supertypeConstraints != null) {
for (TypeBuilder supertype in supertypeConstraints) {
@@ -1854,6 +1877,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNativeFunctionBody(Token nativeToken, Token semicolon) {
debugEvent("NativeFunctionBody");
if (nativeMethodName != null) {
@@ -1864,6 +1888,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNativeFunctionBodyIgnored(Token nativeToken, Token semicolon) {
debugEvent("NativeFunctionBodyIgnored");
}
@@ -1881,6 +1906,7 @@
void handleNoFunctionBody(Token token) {
debugEvent("NoFunctionBody");
if (nativeMethodName != null) {
+ // Coverage-ignore-block(suite): Not run.
push(MethodBody.Regular);
} else {
push(MethodBody.Abstract);
@@ -1909,6 +1935,7 @@
DeclarationContext declarationContext;
switch (declarationKind) {
case DeclarationKind.TopLevel:
+ // Coverage-ignore(suite): Not run.
assert(
false,
"Expected top level method to be handled by "
@@ -1978,15 +2005,18 @@
}
}
if (covariantToken != null) {
+ // Coverage-ignore-block(suite): Not run.
modifiers ??= <Modifier>[];
modifiers.add(Covariant);
}
if (varFinalOrConst != null) {
String lexeme = varFinalOrConst.lexeme;
if (identical('var', lexeme)) {
+ // Coverage-ignore-block(suite): Not run.
modifiers ??= <Modifier>[];
modifiers.add(Var);
} else if (identical('final', lexeme)) {
+ // Coverage-ignore-block(suite): Not run.
modifiers ??= <Modifier>[];
modifiers.add(Final);
} else {
@@ -2147,7 +2177,9 @@
_builderFactory.endNestedDeclaration(scopeKind, "#method");
if (identifier is! Identifier) {
- assert(identifier is ParserRecovery,
+ assert(
+ identifier is ParserRecovery,
+ // Coverage-ignore(suite): Not run.
"Unexpected identifier $identifier (${identifier.runtimeType})");
nativeMethodName = null;
inConstructor = false;
@@ -2188,6 +2220,7 @@
template = templateOperatorParameterMismatch2;
break;
+ // Coverage-ignore(suite): Not run.
default:
unhandled("$requiredArgumentCount", "operatorRequiredArgumentCount",
identifier.nameOffset, uri);
@@ -2224,8 +2257,11 @@
isAbstract = false;
}
if (returnType != null && !returnType.isVoidType) {
- addProblem(messageNonVoidReturnSetter,
- returnType.charOffset ?? beginToken.charOffset, noLength);
+ addProblem(
+ messageNonVoidReturnSetter,
+ returnType.charOffset ?? // Coverage-ignore(suite): Not run.
+ beginToken.charOffset,
+ noLength);
// Use implicit void as recovery.
returnType = null;
}
@@ -2233,8 +2269,11 @@
if (operator == Operator.indexSet &&
returnType != null &&
!returnType.isVoidType) {
- addProblem(messageNonVoidReturnOperator,
- returnType.charOffset ?? beginToken.offset, noLength);
+ addProblem(
+ messageNonVoidReturnOperator,
+ returnType.charOffset ?? // Coverage-ignore(suite): Not run.
+ beginToken.offset,
+ noLength);
// Use implicit void as recovery.
returnType = null;
}
@@ -2354,8 +2393,11 @@
modifiers &= ~constMask;
}
if (returnType != null) {
- addProblem(messageConstructorWithReturnType,
- returnType.charOffset ?? beginToken.offset, noLength);
+ addProblem(
+ messageConstructorWithReturnType,
+ returnType.charOffset ?? // Coverage-ignore(suite): Not run.
+ beginToken.offset,
+ noLength);
returnType = null;
}
final int startCharOffset =
@@ -2378,6 +2420,7 @@
methodKind == _MethodKind.mixinConstructor);
} else {
if (isConst) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(danrubel): consider removing this
// because it is an error to have a const method.
modifiers &= ~constMask;
@@ -2455,6 +2498,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNamedRecordField(Token colon) {
debugEvent("handleNamedRecordField");
assert(checkState(colon, [
@@ -2601,6 +2645,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleInvalidTypeArguments(Token token) {
debugEvent("handleInvalidTypeArguments");
pop(NullValues.TypeArguments);
@@ -2613,6 +2658,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleNonNullAssertExpression(Token bang) {}
@override
@@ -2817,6 +2863,7 @@
Object? last = pop();
count--;
if (last is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
discard(count);
} else if (last is List<FormalParameterBuilder>) {
formals = const FixedNullableList<FormalParameterBuilder>()
@@ -2860,6 +2907,7 @@
}
if (formal.name == FormalParameterBuilder.noNameSentinel) continue;
if (seenNames.containsKey(formal.name)) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(
templateDuplicatedParameterName.withArguments(formal.name),
formal.charOffset,
@@ -3040,7 +3088,9 @@
EnumConstantInfo? info = enumConstantInfos[index];
if (info == null) {
parsedEnumConstantInfos = enumConstantInfos.take(index).toList();
- } else if (parsedEnumConstantInfos != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (parsedEnumConstantInfos != null) {
parsedEnumConstantInfos.add(info);
}
}
@@ -3068,6 +3118,7 @@
if (identifier is Identifier) {
if (enumConstantInfos == null) {
if (!leftBrace.isSynthetic) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(messageEnumDeclarationEmpty, identifier.token.offset,
identifier.token.length);
}
@@ -3295,6 +3346,7 @@
// Create a nested declaration that is ended below by
// `library.addFunctionType`.
if (name is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
pop(NullValues.Metadata); // Metadata.
_builderFactory
.endNestedDeclaration(
@@ -3322,6 +3374,7 @@
pop(NullValues.NominalVariables) as List<NominalVariableBuilder>?;
name = pop();
if (name is ParserRecovery) {
+ // Coverage-ignore-block(suite): Not run.
pop(NullValues.Metadata); // Metadata.
_builderFactory
.endNestedDeclaration(
@@ -3486,6 +3539,7 @@
/* metadata = */ ValueKinds.MetadataListOrNull,
]));
if (externalToken != null && lateToken != null) {
+ // Coverage-ignore-block(suite): Not run.
handleRecoverableError(
messageExternalLateField, externalToken, externalToken);
externalToken = null;
@@ -3539,7 +3593,9 @@
handleRecoverableError(
messageAbstractLateField, abstractToken, abstractToken);
abstractToken = null;
- } else if (externalToken != null && lateToken != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (externalToken != null && lateToken != null) {
handleRecoverableError(
messageExternalLateField, externalToken, externalToken);
externalToken = null;
@@ -3650,6 +3706,7 @@
typeParameters[index].bound = bound;
if (variance != null) {
if (!libraryFeatures.variance.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
reportVarianceModifierNotEnabled(variance);
}
typeParameters[index].variance =
@@ -3668,6 +3725,7 @@
}
if (inConstructorName) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(messageConstructorWithTypeParameters,
offsetForToken(beginToken), lengthOfSpan(beginToken, endToken));
inConstructorName = false;
@@ -3745,6 +3803,7 @@
// For entries that consist of their name only, all of the elements
// of the constructor reference should be null.
if (typeArguments != null || suffix != null) {
+ // Coverage-ignore-block(suite): Not run.
_compilationUnit.reportFeatureNotEnabled(
libraryFeatures.enhancedEnums, uri, charOffset, noLength);
}
@@ -3765,6 +3824,7 @@
DeclarationContext declarationContext;
switch (declarationKind) {
case DeclarationKind.TopLevel:
+ // Coverage-ignore(suite): Not run.
throw new UnsupportedError("Unexpected top level factory method.");
case DeclarationKind.Class:
declarationContext = DeclarationContext.ClassFactory;
@@ -3832,6 +3892,7 @@
}
List<MetadataBuilder>? metadata = pop() as List<MetadataBuilder>?;
if (name is! Identifier) {
+ // Coverage-ignore-block(suite): Not run.
assert(name is ParserRecovery,
"Unexpected name $name (${name.runtimeType}).");
_builderFactory.endNestedDeclaration(
@@ -3954,6 +4015,7 @@
void handleConstFactory(Token constKeyword) {
debugEvent("ConstFactory");
if (!libraryFeatures.constFunctions.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
handleRecoverableError(messageConstFactory, constKeyword, constKeyword);
}
}
@@ -4190,10 +4252,13 @@
return false;
case MemberKind.NonStaticMethod:
case MemberKind.ExtensionTypeNonStaticMethod:
+ // Coverage-ignore(suite): Not run.
// These can be inferred but cannot hold parameters so the cases are
// dead code:
case MemberKind.NonStaticField:
+ // Coverage-ignore(suite): Not run.
case MemberKind.StaticField:
+ // Coverage-ignore(suite): Not run.
case MemberKind.TopLevelField:
return true;
}
diff --git a/pkg/front_end/lib/src/source/redirecting_factory_body.dart b/pkg/front_end/lib/src/source/redirecting_factory_body.dart
index 1a239a5..db47a2d 100644
--- a/pkg/front_end/lib/src/source/redirecting_factory_body.dart
+++ b/pkg/front_end/lib/src/source/redirecting_factory_body.dart
@@ -32,6 +32,7 @@
return new ConstructorInvocation(target, args)
..fileOffset = function.fileOffset;
} else {
+ // Coverage-ignore-block(suite): Not run.
throw 'Unexpected target for redirecting factory:'
' ${target.runtimeType} $target';
}
diff --git a/pkg/front_end/lib/src/source/source_builder_mixins.dart b/pkg/front_end/lib/src/source/source_builder_mixins.dart
index 86fe95c..1661d36 100644
--- a/pkg/front_end/lib/src/source/source_builder_mixins.dart
+++ b/pkg/front_end/lib/src/source/source_builder_mixins.dart
@@ -60,6 +60,7 @@
Builder? objectSetter =
objectClassBuilder.lookupLocalMember(name, setter: true);
if (objectGetter != null && !objectGetter.isStatic ||
+ // Coverage-ignore(suite): Not run.
objectSetter != null && !objectSetter.isStatic) {
addProblem(
// TODO(johnniwinther): Use a different error message for extension
@@ -70,6 +71,7 @@
name.length);
}
if (declaration.parent != this) {
+ // Coverage-ignore-block(suite): Not run.
if (fileUri != declaration.parent!.fileUri) {
unexpected("$fileUri", "${declaration.parent!.fileUri}", charOffset,
fileUri);
@@ -107,10 +109,12 @@
includeAugmentations: true));
while (iterator.moveNext()) {
SourceMemberBuilder declaration = iterator.current;
- count += declaration.buildBodyNodes((
- {required Member member,
- Member? tearOff,
- required BuiltMemberKind kind}) {
+ count += declaration.buildBodyNodes(
+ // Coverage-ignore(suite): Not run.
+ (
+ {required Member member,
+ Member? tearOff,
+ required BuiltMemberKind kind}) {
_buildMember(declaration, member, tearOff, kind,
addMembersToLibrary: addMembersToLibrary);
});
@@ -134,7 +138,9 @@
setterDeclaration as ProcedureBuilder, typeEnvironment);
}
}
- } else if (builder is SourceConstructorBuilder) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (builder is SourceConstructorBuilder) {
builder.checkTypes(libraryBuilder, typeEnvironment);
} else {
assert(false, "Unexpected member: $builder.");
@@ -311,6 +317,7 @@
scope.forEachLocalSetter((String name, Builder setter) {
Builder? constructor = constructorScope.lookupLocalMember(name);
if (constructor == null || !setter.isStatic) return;
+ // Coverage-ignore-block(suite): Not run.
addProblem(templateConflictsWithConstructor.withArguments(name),
setter.charOffset, noLength);
addProblem(templateConflictsWithSetter.withArguments(name),
diff --git a/pkg/front_end/lib/src/source/source_class_builder.dart b/pkg/front_end/lib/src/source/source_class_builder.dart
index 3fc6adf..b709f64 100644
--- a/pkg/front_end/lib/src/source/source_class_builder.dart
+++ b/pkg/front_end/lib/src/source/source_class_builder.dart
@@ -143,7 +143,9 @@
}
void set isConflictingAugmentationMember(bool value) {
- assert(_isConflictingAugmentationMember == null,
+ assert(
+ _isConflictingAugmentationMember == null,
+ // Coverage-ignore(suite): Not run.
'$this.isConflictingAugmentationMember has already been fixed.');
_isConflictingAugmentationMember = value;
}
@@ -187,9 +189,13 @@
actualCls.hasConstConstructor = declaresConstConstructor;
}
- MergedClassMemberScope get mergedScope => _mergedScope ??=
- isAugmenting ? origin.mergedScope : new MergedClassMemberScope(this);
+ MergedClassMemberScope get mergedScope => _mergedScope ??= isAugmenting
+ ?
+ // Coverage-ignore(suite): Not run.
+ origin.mergedScope
+ : new MergedClassMemberScope(this);
+ // Coverage-ignore(suite): Not run.
List<SourceClassBuilder>? get augmentationsForTesting => _augmentations;
SourceClassBuilder? actualOrigin;
@@ -214,6 +220,7 @@
void buildBuilders(Builder declaration) {
if (declaration.parent != this) {
if (declaration.parent?.origin != origin) {
+ // Coverage-ignore-block(suite): Not run.
if (fileUri != declaration.parent?.fileUri) {
unexpected("$fileUri", "${declaration.parent?.fileUri}", charOffset,
fileUri);
@@ -256,7 +263,9 @@
}
if (!isMixinDeclaration &&
actualCls.supertype != null &&
+ // Coverage-ignore(suite): Not run.
actualCls.superclass!.isMixinDeclaration) {
+ // Coverage-ignore-block(suite): Not run.
// Declared mixins have interfaces that can be implemented, but they
// cannot be extended. However, a mixin declaration with a single
// superclass constraint is encoded with the constraint as the supertype,
@@ -390,11 +399,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> localMemberIterator<T extends Builder>() =>
new ClassDeclarationMemberIterator<SourceClassBuilder, T>.local(this,
includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> localConstructorIterator<T extends MemberBuilder>() =>
new ClassDeclarationConstructorIterator<SourceClassBuilder, T>.local(this,
includeDuplicates: false);
@@ -406,6 +417,7 @@
includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
NameIterator<T> fullMemberNameIterator<T extends Builder>() =>
new ClassDeclarationMemberNameIterator<SourceClassBuilder, T>(
const _SourceClassBuilderAugmentationAccess(), this,
@@ -559,6 +571,7 @@
int originLength = typeVariables?.length ?? 0;
int augmentationLength = augmentation.typeVariables?.length ?? 0;
if (originLength != augmentationLength) {
+ // Coverage-ignore-block(suite): Not run.
augmentation.addProblem(messagePatchClassTypeVariablesMismatch,
augmentation.charOffset, noLength, context: [
messagePatchClassOrigin.withLocation(fileUri, charOffset, noLength)
@@ -570,6 +583,7 @@
}
}
} else {
+ // Coverage-ignore-block(suite): Not run.
libraryBuilder.addProblem(messagePatchDeclarationMismatch,
augmentation.charOffset, noLength, augmentation.fileUri, context: [
messagePatchDeclarationOrigin.withLocation(
@@ -667,6 +681,7 @@
!customValuesDeclaration.isStatic) {
// Retrieve the earliest declaration for error reporting.
while (customValuesDeclaration?.next != null) {
+ // Coverage-ignore-block(suite): Not run.
customValuesDeclaration = customValuesDeclaration?.next;
}
libraryBuilder.addProblem(
@@ -682,6 +697,7 @@
!customValuesDeclaration.isStatic) {
// Retrieve the earliest declaration for error reporting.
while (customValuesDeclaration?.next != null) {
+ // Coverage-ignore-block(suite): Not run.
customValuesDeclaration = customValuesDeclaration?.next;
}
libraryBuilder.addProblem(
@@ -729,6 +745,7 @@
}
}
}
+ // Coverage-ignore(suite): Not run.
if (macroClass != null && !cls.isMacro && !cls.isAbstract) {
// TODO(johnniwinther): Merge this check with the loop above.
bool isMacroFound = false;
@@ -755,6 +772,7 @@
int nameOffset = target.typeName.nameOffset;
int nameLength = target.typeName.nameLength;
if (aliasBuilder != null) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(message, nameOffset, nameLength, context: [
messageTypedefCause.withLocation(
aliasBuilder.fileUri, aliasBuilder.charOffset, noLength),
@@ -780,6 +798,7 @@
// TODO(eernst): Should gather 'restricted supertype' checks in one place,
// e.g., dynamic/int/String/Null and more are checked elsewhere.
if (decl is VoidTypeDeclarationBuilder) {
+ // Coverage-ignore-block(suite): Not run.
fail(superClassType, messageExtendsVoid, aliasBuilder);
} else if (decl is NeverTypeDeclarationBuilder) {
fail(superClassType, messageExtendsNever, aliasBuilder);
@@ -819,7 +838,9 @@
}
}
if (classHierarchyNode.isMixinApplication) {
- assert(mixedInTypeBuilder != null,
+ assert(
+ mixedInTypeBuilder != null,
+ // Coverage-ignore(suite): Not run.
"No mixed in type builder for mixin application $this.");
ClassHierarchyNode mixedInNode = classHierarchyNode.mixedInNode!;
ClassHierarchyNode? mixinSuperClassNode =
@@ -864,8 +885,11 @@
this.charOffset,
noLength);
} else if (interface.cls.name == "FutureOr" &&
+ // Coverage-ignore(suite): Not run.
interface.cls.enclosingLibrary.importUri.isScheme("dart") &&
+ // Coverage-ignore(suite): Not run.
interface.cls.enclosingLibrary.importUri.path == "async") {
+ // Coverage-ignore-block(suite): Not run.
addProblem(messageImplementsFutureOr, this.charOffset, noLength);
} else if (implemented.contains(interface)) {
// Aggregate repetitions.
@@ -881,6 +905,7 @@
if (decl != superClass) {
// TODO(eernst): Have all 'restricted supertype' checks in one place.
if (decl is VoidTypeDeclarationBuilder) {
+ // Coverage-ignore-block(suite): Not run.
fail(type, messageImplementsVoid, aliasBuilder);
} else if (decl is NeverTypeDeclarationBuilder) {
fail(type, messageImplementsNever, aliasBuilder);
@@ -966,6 +991,7 @@
variance.keyword,
supertype.typeName!.name);
} else {
+ // Coverage-ignore-block(suite): Not run.
message =
templateInvalidTypeVariableInSupertypeWithVariance.withArguments(
typeVariables![i].variance.keyword,
@@ -1062,6 +1088,7 @@
SourceLibraryBuilder library = this.libraryBuilder;
if (!typeParameter.isLegacyCovariant &&
!variance.greaterThanOrEqual(typeParameter.variance)) {
+ // Coverage-ignore-block(suite): Not run.
Message message;
if (isReturnType) {
message = templateInvalidTypeVariableVariancePositionInReturnType
@@ -1127,6 +1154,7 @@
required BuiltMemberKind kind}) {
_addMemberToClass(builder, member);
if (tearOff != null) {
+ // Coverage-ignore-block(suite): Not run.
_addMemberToClass(builder, tearOff);
}
});
@@ -1150,7 +1178,9 @@
!memberBuilder.isDuplicate &&
!memberBuilder.isConflictingSetter) {
if (memberBuilder.isConflictingAugmentationMember) {
- if (member is Field && member.isStatic ||
+ if (member is Field &&
+ // Coverage-ignore(suite): Not run.
+ member.isStatic ||
member is Procedure && member.isStatic) {
member.name = new Name(
'${member.name}'
@@ -1300,6 +1330,7 @@
memberHierarchy, interfaceMember, isSetter, callback);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
assert(
false,
"Unexpected procedure kind in override check: "
@@ -1422,6 +1453,7 @@
.performNullabilityAwareMutualSubtypesCheck(
declaredBound, computedBound)
.isSubtypeWhenUsingNullabilities()) {
+ // Coverage-ignore-block(suite): Not run.
reportInvalidOverride(
isInterfaceCheck,
declaredMember,
@@ -1718,6 +1750,7 @@
while (declaredNamedParameters.current.name !=
interfaceNamedParameters.current.name) {
if (!declaredNamedParameters.moveNext()) {
+ // Coverage-ignore-block(suite): Not run.
reportInvalidOverride(
isInterfaceCheck,
declaredMember,
@@ -1753,6 +1786,7 @@
isInterfaceCheck);
if (declaredParameter.isRequired &&
!interfaceNamedParameters.current.isRequired) {
+ // Coverage-ignore-block(suite): Not run.
reportInvalidOverride(
isInterfaceCheck,
declaredMember,
@@ -1926,6 +1960,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
/// Returns an iterator the origin class and all augmentations in application
/// order.
Iterator<SourceClassBuilder> get declarationIterator =>
@@ -1953,9 +1988,11 @@
int? getOverlookedOverrideProblemChoice(DeclarationBuilder declarationBuilder) {
String uri = '${declarationBuilder.libraryBuilder.importUri}';
if (uri == 'dart:js' &&
+ // Coverage-ignore(suite): Not run.
declarationBuilder.fileUri.pathSegments.last == 'js.dart') {
return 0;
} else if (uri == 'dart:_interceptors' &&
+ // Coverage-ignore(suite): Not run.
declarationBuilder.fileUri.pathSegments.last == 'js_number.dart') {
return 1;
}
diff --git a/pkg/front_end/lib/src/source/source_constructor_builder.dart b/pkg/front_end/lib/src/source/source_constructor_builder.dart
index efe4a8e..cc6d37e 100644
--- a/pkg/front_end/lib/src/source/source_constructor_builder.dart
+++ b/pkg/front_end/lib/src/source/source_constructor_builder.dart
@@ -153,6 +153,7 @@
_hasFormalsInferred = true;
}
+ // Coverage-ignore(suite): Not run.
void _inferSuperInitializingFormals(ClassHierarchyBase hierarchy) {}
void _buildFormals(Member member) {
@@ -352,6 +353,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void checkVariance(
SourceClassBuilder sourceClassBuilder, TypeEnvironment typeEnvironment) {}
@@ -362,10 +364,12 @@
}
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get localMembers =>
throw new UnsupportedError('${runtimeType}.localMembers');
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get localSetters =>
throw new UnsupportedError('${runtimeType}.localSetters');
}
@@ -449,6 +453,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Name get memberName => _memberName.name;
@override
@@ -464,6 +469,7 @@
_constructor as Member;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -473,6 +479,7 @@
FunctionNode get function => _constructor.function;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => [constructor];
@override
@@ -481,12 +488,14 @@
@override
DeclaredSourceConstructorBuilder get origin => actualOrigin ?? this;
+ // Coverage-ignore(suite): Not run.
List<SourceConstructorBuilder>? get augmentationsForTesting => _augmentations;
@override
bool get isDeclarationInstanceMember => false;
@override
+ // Coverage-ignore(suite): Not run.
bool get isClassInstanceMember => false;
@override
@@ -895,6 +904,7 @@
(_augmentations ??= []).add(augmentation);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
reportAugmentationMismatch(augmentation);
}
}
@@ -1015,13 +1025,16 @@
super(constructor, constructorTearOff, parent);
@override
+ // Coverage-ignore(suite): Not run.
SourceLibraryBuilder get libraryBuilder =>
super.libraryBuilder as SourceLibraryBuilder;
@override
+ // Coverage-ignore(suite): Not run.
DeclarationBuilder get declarationBuilder => classBuilder!;
@override
+ // Coverage-ignore(suite): Not run.
bool get isRedirecting {
for (Initializer initializer in constructor.initializers) {
if (initializer is RedirectingInitializer) {
@@ -1083,6 +1096,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void checkVariance(
SourceClassBuilder sourceClassBuilder, TypeEnvironment typeEnvironment) {}
@@ -1156,6 +1170,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Name get memberName => _memberName.name;
SourceExtensionTypeDeclarationBuilder get extensionTypeDeclarationBuilder =>
@@ -1165,9 +1180,12 @@
Member get member => _constructor;
@override
- Member get readTarget => _constructorTearOff ?? _constructor;
+ Member get readTarget =>
+ _constructorTearOff ?? // Coverage-ignore(suite): Not run.
+ _constructor;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
@@ -1177,9 +1195,11 @@
FunctionNode get function => _constructor.function;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => [_constructor];
@override
+ // Coverage-ignore(suite): Not run.
void addSuperParameterDefaultValueCloners(
List<DelayedDefaultValueCloner> delayedDefaultValueCloners) {}
@@ -1424,16 +1444,19 @@
..fileOffset = node.fileOffset;
return;
}
+ // Coverage-ignore-block(suite): Not run.
throw new UnsupportedError(
"Unexpected initializer $node (${node.runtimeType})");
}
@override
+ // Coverage-ignore(suite): Not run.
void visitAssertInitializer(AssertInitializer node) {
statements.add(node.statement);
}
@override
+ // Coverage-ignore(suite): Not run.
void visitFieldInitializer(FieldInitializer node) {
thisVariable
..initializer = (node.value..parent = thisVariable)
@@ -1441,6 +1464,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitInvalidInitializer(InvalidInitializer node) {
statements.add(new ExpressionStatement(
new InvalidExpression(null)..fileOffset = node.fileOffset)
@@ -1459,6 +1483,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitSuperInitializer(SuperInitializer node) {
// TODO(johnniwinther): Report error for this case.
}
diff --git a/pkg/front_end/lib/src/source/source_enum_builder.dart b/pkg/front_end/lib/src/source/source_enum_builder.dart
index ca0e03d..3fe988d 100644
--- a/pkg/front_end/lib/src/source/source_enum_builder.dart
+++ b/pkg/front_end/lib/src/source/source_enum_builder.dart
@@ -164,6 +164,7 @@
NamedTypeBuilder objectType = new NamedTypeBuilderImpl(
const PredefinedTypeName("Object"), const NullabilityBuilder.omitted(),
instanceTypeVariableAccess: InstanceTypeVariableAccessState.Unexpected);
+ // Coverage-ignore(suite): Not run.
supertypeBuilder ??= new NamedTypeBuilderImpl(
const PredefinedTypeName("_Enum"), const NullabilityBuilder.omitted(),
instanceTypeVariableAccess: InstanceTypeVariableAccessState.Unexpected);
@@ -256,6 +257,7 @@
!customIndexDeclaration.isAbstract) {
// Retrieve the earliest declaration for error reporting.
while (customIndexDeclaration?.next != null) {
+ // Coverage-ignore-block(suite): Not run.
customIndexDeclaration = customIndexDeclaration?.next;
}
libraryBuilder.addProblem(
@@ -633,6 +635,7 @@
MemberBuilder? superConstructor = enumClass.findConstructorOrFactory(
"", charOffset, fileUri, libraryBuilder);
if (superConstructor == null || !superConstructor.isConstructor) {
+ // Coverage-ignore-block(suite): Not run.
// TODO(ahe): Ideally, we would also want to check that [Object]'s
// unnamed constructor requires no arguments. But that information
// isn't always available at this point, and it's not really a
@@ -862,11 +865,13 @@
? classHierarchy.getDispatchTarget(cls.superclass!, toStringName)
: null;
Procedure? toStringSuperTarget = superToString is Procedure &&
+ // Coverage-ignore(suite): Not run.
superToString.enclosingClass != classHierarchy.coreTypes.objectClass
? superToString
: null;
if (toStringSuperTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
toStringBuilder.member.transformerFlags |= TransformerFlag.superCalls;
toStringBuilder.body = new ReturnStatement(new SuperMethodInvocation(
toStringName, new Arguments([]), toStringSuperTarget));
diff --git a/pkg/front_end/lib/src/source/source_extension_builder.dart b/pkg/front_end/lib/src/source/source_extension_builder.dart
index 249b647..d1c9c51 100644
--- a/pkg/front_end/lib/src/source/source_extension_builder.dart
+++ b/pkg/front_end/lib/src/source/source_extension_builder.dart
@@ -75,13 +75,18 @@
@override
SourceExtensionBuilder get origin => _origin ?? this;
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): Add merged scope for extensions.
MergedClassMemberScope get mergedScope => _mergedScope ??= isAugmenting
? origin.mergedScope
: throw new UnimplementedError("SourceExtensionBuilder.mergedScope");
@override
- Extension get extension => isAugmenting ? origin._extension : _extension;
+ Extension get extension => isAugmenting
+ ?
+ // Coverage-ignore(suite): Not run.
+ origin._extension
+ : _extension;
@override
BodyBuilderContext createBodyBuilderContext(
@@ -115,6 +120,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void addMemberInternal(SourceMemberBuilder memberBuilder,
BuiltMemberKind memberKind, Member member, Member? tearOff) {
unhandled("${memberBuilder.runtimeType}:${memberKind}", "addMemberInternal",
@@ -143,6 +149,7 @@
case BuiltMemberKind.ExtensionTypeFactory:
case BuiltMemberKind.ExtensionTypeRedirectingFactory:
case BuiltMemberKind.ExtensionTypeRepresentationField:
+ // Coverage-ignore(suite): Not run.
unhandled(
"${memberBuilder.runtimeType}:${memberKind}",
"addMemberDescriptorInternal",
@@ -176,6 +183,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void applyAugmentation(Builder augmentation) {
if (augmentation is SourceExtensionBuilder) {
augmentation._origin = this;
diff --git a/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart b/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart
index fef1f4c..7dd46db 100644
--- a/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart
@@ -101,6 +101,7 @@
@override
SourceExtensionTypeDeclarationBuilder get origin => _origin ?? this;
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): Add merged scope for extension type declarations.
MergedClassMemberScope get mergedScope => _mergedScope ??= isAugmenting
? origin.mergedScope
@@ -109,7 +110,9 @@
@override
ExtensionTypeDeclaration get extensionTypeDeclaration => isAugmenting
- ? origin._extensionTypeDeclaration
+ ?
+ // Coverage-ignore(suite): Not run.
+ origin._extensionTypeDeclaration
: _extensionTypeDeclaration;
@override
@@ -155,6 +158,7 @@
templateWrongTypeParameterVarianceInSuperinterface
.withArguments(variable.name, interface);
} else {
+ // Coverage-ignore-block(suite): Not run.
errorMessage =
templateInvalidTypeVariableInSupertypeWithVariance
.withArguments(variable.variance.keyword, variable.name,
@@ -203,6 +207,7 @@
if (LibraryBuilder.isFunction(cls, coreLibrary) ||
LibraryBuilder.isRecord(cls, coreLibrary)) {
if (aliasBuilder != null) {
+ // Coverage-ignore-block(suite): Not run.
errorMessage = templateSuperExtensionTypeIsIllegalAliased
.withArguments(typeBuilder.fullNameForErrors, interface);
errorContext = [
@@ -221,6 +226,7 @@
errorMessage = templateSuperExtensionTypeIsTypeVariable
.withArguments(typeBuilder.fullNameForErrors);
if (aliasBuilder != null) {
+ // Coverage-ignore-block(suite): Not run.
errorContext = [
messageTypedefCause.withLocation(
aliasBuilder.fileUri, aliasBuilder.charOffset, noLength),
@@ -374,9 +380,11 @@
case ClassBuilder():
typeParameters = declaration.typeVariables;
case TypeAliasBuilder():
+ // Coverage-ignore(suite): Not run.
typeParameters = declaration.typeVariables;
case ExtensionTypeDeclarationBuilder():
typeParameters = declaration.typeParameters;
+ // Coverage-ignore(suite): Not run.
case BuiltinTypeDeclarationBuilder():
case InvalidTypeDeclarationBuilder():
case OmittedTypeDeclarationBuilder():
@@ -596,13 +604,16 @@
case BuiltMemberKind.ExtensionTypeSetter:
case BuiltMemberKind.LateSetter:
case BuiltMemberKind.ExtensionTypeOperator:
+ // Coverage-ignore(suite): Not run.
unhandled(
"${memberBuilder.runtimeType}:${memberKind}",
"addMemberInternal",
memberBuilder.charOffset,
memberBuilder.fileUri);
case BuiltMemberKind.ExtensionTypeRepresentationField:
- assert(tearOff == null, "Unexpected tear-off $tearOff");
+ assert(
+ tearOff == null, // Coverage-ignore(suite): Not run.
+ "Unexpected tear-off $tearOff");
extensionTypeDeclaration.addProcedure(member as Procedure);
}
}
@@ -626,6 +637,7 @@
case BuiltMemberKind.ExtensionSetter:
case BuiltMemberKind.ExtensionOperator:
case BuiltMemberKind.ExtensionTypeRepresentationField:
+ // Coverage-ignore(suite): Not run.
unhandled("${memberBuilder.runtimeType}:${memberKind}", "buildMembers",
memberBuilder.charOffset, memberBuilder.fileUri);
case BuiltMemberKind.ExtensionField:
@@ -666,6 +678,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void applyAugmentation(Builder augmentation) {
if (augmentation is SourceExtensionTypeDeclarationBuilder) {
augmentation._origin = this;
@@ -699,6 +712,7 @@
/// builder.
SourceExtensionTypeConstructorBuilder? lookupConstructor(Name name) {
if (name.text == "new") {
+ // Coverage-ignore-block(suite): Not run.
name = new Name("", name.library);
}
@@ -722,6 +736,7 @@
includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
NameIterator<T> fullMemberNameIterator<T extends Builder>() =>
new ClassDeclarationMemberNameIterator<
SourceExtensionTypeDeclarationBuilder, T>(
@@ -746,6 +761,7 @@
includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
bool get isMixinDeclaration => false;
@override
@@ -789,16 +805,19 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> localMemberIterator<T extends Builder>() =>
new ClassDeclarationMemberIterator<SourceExtensionTypeDeclarationBuilder,
T>.local(this, includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> localConstructorIterator<T extends MemberBuilder>() =>
new ClassDeclarationConstructorIterator<
SourceExtensionTypeDeclarationBuilder,
T>.local(this, includeDuplicates: false);
+ // Coverage-ignore(suite): Not run.
/// Returns an iterator the origin extension type declaration and all
/// augmentations in application order.
Iterator<SourceExtensionTypeDeclarationBuilder> get declarationIterator =>
diff --git a/pkg/front_end/lib/src/source/source_factory_builder.dart b/pkg/front_end/lib/src/source/source_factory_builder.dart
index 721baf5..2d9d718 100644
--- a/pkg/front_end/lib/src/source/source_factory_builder.dart
+++ b/pkg/front_end/lib/src/source/source_factory_builder.dart
@@ -113,11 +113,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Name get memberName => _memberName.name;
@override
DeclarationBuilder get declarationBuilder => super.declarationBuilder!;
+ // Coverage-ignore(suite): Not run.
List<SourceFactoryBuilder>? get augmentationsForTesting => _augmentations;
@override
@@ -156,12 +158,14 @@
Member? get readTarget => origin._factoryTearOff ?? _procedure;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
Member? get invokeTarget => _procedure;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => [_procedure];
@override
@@ -226,10 +230,12 @@
}
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get localMembers =>
throw new UnsupportedError('${runtimeType}.localMembers');
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get localSetters =>
throw new UnsupportedError('${runtimeType}.localSetters');
@@ -250,6 +256,7 @@
new RedirectingFactoryTarget(target, typeArguments);
bodyInternal?.parent = function;
if (isAugmenting) {
+ // Coverage-ignore-block(suite): Not run.
actualOrigin!.setRedirectingFactoryBody(target, typeArguments);
}
}
@@ -262,6 +269,7 @@
(_augmentations ??= []).add(augmentation);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
reportAugmentationMismatch(augmentation);
}
}
@@ -282,6 +290,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void checkVariance(
SourceClassBuilder sourceClassBuilder, TypeEnvironment typeEnvironment) {}
@@ -324,6 +333,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors {
return "${flattenName(declarationBuilder.name, charOffset, fileUri)}"
"${name.isEmpty ? '' : '.$name'}";
@@ -397,6 +407,7 @@
// Ensure that constant factories only have constant targets/bodies.
if (isConst && !target.isConst) {
+ // Coverage-ignore-block(suite): Not run.
libraryBuilder.addProblem(messageConstFactoryRedirectionToNonConst,
charOffset, noLength, fileUri);
}
@@ -512,7 +523,9 @@
}
if (targetBuilder is FunctionBuilder) {
target = targetBuilder.member;
- } else if (targetBuilder is DillMemberBuilder) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (targetBuilder is DillMemberBuilder) {
target = targetBuilder.member;
} else {
unhandled("${targetBuilder.runtimeType}", "buildOutlineExpressions",
@@ -557,6 +570,7 @@
?.map(substitution.substituteType)
.toList();
} else {
+ // Coverage-ignore-block(suite): Not run.
typeArguments = redirectingFactoryTarget.typeArguments;
}
target = redirectingFactoryTarget.target;
@@ -565,6 +579,7 @@
if (target is Constructor ||
target is Procedure &&
(target.isFactory || target.isExtensionTypeMember)) {
+ // Coverage-ignore(suite): Not run.
typeArguments ??= [];
if (_factoryTearOff != null) {
delayedDefaultValueCloners.add(buildRedirectingFactoryTearOffBody(
@@ -590,6 +605,7 @@
SourceFactoryBuilder redirectingOrigin = origin;
if (redirectingOrigin is RedirectingFactoryBuilder) {
+ // Coverage-ignore-block(suite): Not run.
redirectingOrigin.typeArguments = typeArguments;
}
}
@@ -599,6 +615,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void checkVariance(
SourceClassBuilder sourceClassBuilder, TypeEnvironment typeEnvironment) {}
@@ -663,6 +680,7 @@
// [typeParameter].
if (!typeEnvironment.isSubtypeOf(typeArgument, typeParameterBound,
SubtypeCheckMode.ignoringNullabilities)) {
+ // Coverage-ignore-block(suite): Not run.
libraryBuilder.addProblemForRedirectingFactory(
factory,
templateRedirectingFactoryIncompatibleTypeArgument.withArguments(
diff --git a/pkg/front_end/lib/src/source/source_field_builder.dart b/pkg/front_end/lib/src/source/source_field_builder.dart
index c2d9e70..80be196 100644
--- a/pkg/front_end/lib/src/source/source_field_builder.dart
+++ b/pkg/front_end/lib/src/source/source_field_builder.dart
@@ -314,6 +314,7 @@
assert(
overriddenMembers.every((overriddenMember) =>
overriddenMember.declarationBuilder != classBuilder),
+ // Coverage-ignore(suite): Not run.
"Unexpected override dependencies for $this: $overriddenMembers");
_overrideDependencies ??= {};
_overrideDependencies!.addAll(overriddenMembers);
@@ -349,12 +350,17 @@
/// Builds the body of this field using [initializer] as the initializer
/// expression.
void buildBody(CoreTypes coreTypes, Expression? initializer) {
- assert(!hasBodyBeenBuilt, "Body has already been built for $this.");
+ assert(
+ !hasBodyBeenBuilt, // Coverage-ignore(suite): Not run.
+ "Body has already been built for $this.");
hasBodyBeenBuilt = true;
if (!hasInitializer &&
initializer != null &&
+ // Coverage-ignore(suite): Not run.
initializer is! NullLiteral &&
+ // Coverage-ignore(suite): Not run.
!isConst &&
+ // Coverage-ignore(suite): Not run.
!isFinal) {
internalProblem(
messageInternalProblemAlreadyInitialized, charOffset, fileUri);
@@ -496,6 +502,7 @@
_constInitializerToken = null;
}
+ // Coverage-ignore(suite): Not run.
bool get hasOutlineExpressionsBuilt => _constInitializerToken == null;
DartType get fieldType => _fieldEncoding.type;
@@ -842,6 +849,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Member? getTearOff(ClassMembersBuilder membersBuilder) {
// Ensure field type is computed.
getMember(membersBuilder);
@@ -971,14 +979,18 @@
}
late_lowering.IsSetEncoding get isSetEncoding {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return _isSetEncoding ??=
late_lowering.computeIsSetEncoding(_type!, _isSetStrategy);
}
@override
void createBodies(CoreTypes coreTypes, Expression? initializer) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
if (isSetEncoding == late_lowering.IsSetEncoding.useSentinel) {
_field.initializer = new StaticInvocation(coreTypes.createSentinelMethod,
new Arguments([], types: [_type!])..fileOffset = fileOffset)
@@ -1030,7 +1042,9 @@
/// sound encoding of fields with type variable type of undetermined
/// nullability.
Expression _createFieldRead({bool needsPromotion = false}) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
if (needsPromotion) {
VariableDeclaration variable = new VariableDeclaration.forValue(
_createFieldGet(_field),
@@ -1095,13 +1109,17 @@
@override
DartType get type {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return _type!;
}
@override
void set type(DartType value) {
- assert(_type == null || _type is InferredType,
+ assert(
+ _type == null || _type is InferredType,
+ // Coverage-ignore(suite): Not run.
"Type has already been computed for field $name.");
_type = value;
if (value is! InferredType) {
@@ -1162,6 +1180,7 @@
..isExtensionMember = isExtensionMember;
isInstanceMember = false;
} else if (isExtensionTypeMember) {
+ // Coverage-ignore-block(suite): Not run.
_field
..isStatic = fieldBuilder.isStatic
..isExtensionTypeMember = true;
@@ -1268,7 +1287,9 @@
@override
Statement _createSetterBody(
CoreTypes coreTypes, String name, VariableDeclaration parameter) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return late_lowering.createSetterBody(
coreTypes, fileOffset, name, parameter, _type!,
shouldReturnValue: false,
@@ -1284,7 +1305,9 @@
@override
Statement _createGetterBody(
CoreTypes coreTypes, String name, Expression? initializer) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return late_lowering.createGetterBodyWithoutInitializer(
coreTypes, fileOffset, name, type,
createVariableRead: _createFieldRead,
@@ -1384,7 +1407,9 @@
@override
Statement _createGetterBody(
CoreTypes coreTypes, String name, Expression? initializer) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return late_lowering.createGetterWithInitializer(
coreTypes, fileOffset, name, _type!, initializer!,
createVariableRead: _createFieldRead,
@@ -1451,7 +1476,9 @@
@override
Statement _createSetterBody(
CoreTypes coreTypes, String name, VariableDeclaration parameter) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return late_lowering.createSetterBodyFinal(
coreTypes, fileOffset, name, parameter, type,
shouldReturnValue: false,
@@ -1503,7 +1530,9 @@
@override
Statement _createGetterBody(
CoreTypes coreTypes, String name, Expression? initializer) {
- assert(_type != null, "Type has not been computed for field $name.");
+ assert(
+ _type != null, // Coverage-ignore(suite): Not run.
+ "Type has not been computed for field $name.");
return late_lowering.createGetterWithInitializerWithRecheck(
coreTypes, fileOffset, name, _type!, initializer!,
createVariableRead: _createFieldRead,
@@ -1522,6 +1551,7 @@
null;
@override
+ // Coverage-ignore(suite): Not run.
Statement _createSetterBody(
CoreTypes coreTypes, String name, VariableDeclaration parameter) =>
throw new UnsupportedError(
@@ -1613,6 +1643,7 @@
DeclarationBuilder get declarationBuilder => fieldBuilder.declarationBuilder!;
@override
+ // Coverage-ignore(suite): Not run.
bool isObjectMember(ClassBuilder objectClass) {
return declarationBuilder == objectClass;
}
@@ -1642,6 +1673,7 @@
Name get name => _name;
@override
+ // Coverage-ignore(suite): Not run.
String get fullName {
String suffix = isSetter ? "=" : "";
String className = declarationBuilder.fullNameForErrors;
@@ -1667,6 +1699,7 @@
bool get hasDeclarations => false;
@override
+ // Coverage-ignore(suite): Not run.
List<ClassMember> get declarations =>
throw new UnsupportedError("$runtimeType.declarations");
@@ -1798,14 +1831,18 @@
@override
DartType get type {
- assert(_type != null,
+ assert(
+ _type != null,
+ // Coverage-ignore(suite): Not run.
"Type has not been computed for field ${_fieldBuilder.name}.");
return _type!;
}
@override
void set type(DartType value) {
- assert(_type == null || _type is InferredType,
+ assert(
+ _type == null || _type is InferredType,
+ // Coverage-ignore(suite): Not run.
"Type has already been computed for field ${_fieldBuilder.name}.");
_type = value;
if (value is! InferredType) {
@@ -1861,6 +1898,7 @@
Procedure? setter = _setter;
if (setter != null) {
if (setter.kind == ProcedureKind.Method) {
+ // Coverage-ignore-block(suite): Not run.
setter.function.positionalParameters[1].type = value;
} else {
setter.function.positionalParameters.first.type = value;
@@ -1935,6 +1973,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void setGenericCovariantImpl() {
_setter!.function.positionalParameters.first.isCovariantByClass = true;
}
@@ -2039,14 +2078,18 @@
@override
DartType get type {
- assert(_type != null,
+ assert(
+ _type != null,
+ // Coverage-ignore(suite): Not run.
"Type has not been computed for field ${_fieldBuilder.name}.");
return _type!;
}
@override
void set type(DartType value) {
- assert(_type == null || _type is InferredType,
+ assert(
+ _type == null || _type is InferredType,
+ // Coverage-ignore(suite): Not run.
"Type has already been computed for field ${_fieldBuilder.name}.");
_type = value;
if (value is! InferredType) {
@@ -2103,9 +2146,11 @@
Member get readTarget => _getter;
@override
+ // Coverage-ignore(suite): Not run.
Member? get writeTarget => null;
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Member> get exportedMembers => [_getter];
@override
@@ -2125,6 +2170,7 @@
const <ClassMember>[];
@override
+ // Coverage-ignore(suite): Not run.
void buildImplicitDefaultValue() {
// Not needed.
}
diff --git a/pkg/front_end/lib/src/source/source_function_builder.dart b/pkg/front_end/lib/src/source/source_function_builder.dart
index c062695..bba40fe 100644
--- a/pkg/front_end/lib/src/source/source_function_builder.dart
+++ b/pkg/front_end/lib/src/source/source_function_builder.dart
@@ -197,6 +197,7 @@
bool get isExternal => (modifiers & externalMask) != 0;
@override
+ // Coverage-ignore(suite): Not run.
bool get isAssignable => false;
/// Returns `true` if this member is augmented, either by being the origin
@@ -283,6 +284,7 @@
return formal;
}
}
+ // Coverage-ignore(suite): Not run.
// If we have any formals we should find the one we're looking for.
assert(false, "$identifier not found in $formals");
}
@@ -309,7 +311,9 @@
// body with null.
TreeNode? parent = function.parent;
if (!(newBody == null &&
+ // Coverage-ignore(suite): Not run.
parent is Procedure &&
+ // Coverage-ignore(suite): Not run.
parent.isForwardingSemiStub)) {
function.body = newBody;
newBody?.parent = function;
@@ -317,6 +321,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool get isNative => nativeMethodName != null;
void buildFunction() {
@@ -440,6 +445,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
VariableDeclaration? getTearOffParameter(int index) => null;
@override
@@ -469,6 +475,7 @@
bool hasBuiltOutlineExpressions = false;
+ // Coverage-ignore(suite): Not run.
bool get needsDefaultValuesBuiltAsOutlineExpressions {
if (formals != null) {
for (FormalParameterBuilder formal in formals!) {
@@ -544,6 +551,7 @@
constructor.member as Constructor, arguments)
..isConst = true;
} else {
+ // Coverage-ignore-block(suite): Not run.
annotation =
new StaticInvocation(constructor.member as Procedure, arguments)
..isConst = true;
@@ -554,6 +562,7 @@
@override
bool checkAugmentation(SourceFunctionBuilder augmentation) {
if (!isExternal && !augmentation.libraryBuilder.isAugmentationLibrary) {
+ // Coverage-ignore-block(suite): Not run.
augmentation.libraryBuilder.addProblem(messagePatchNonExternal,
augmentation.charOffset, noLength, augmentation.fileUri!, context: [
messagePatchDeclarationOrigin.withLocation(
@@ -565,6 +574,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void reportAugmentationMismatch(Builder augmentation) {
libraryBuilder.addProblem(messagePatchDeclarationMismatch,
augmentation.charOffset, noLength, augmentation.fileUri!, context: [
diff --git a/pkg/front_end/lib/src/source/source_library_builder.dart b/pkg/front_end/lib/src/source/source_library_builder.dart
index 583233a..745218c 100644
--- a/pkg/front_end/lib/src/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/source/source_library_builder.dart
@@ -188,7 +188,9 @@
/// This should only be called once.
@override
OffsetMap get offsetMap {
- assert(_offsetMap != null, "No OffsetMap for $this");
+ assert(
+ _offsetMap != null, // Coverage-ignore(suite): Not run.
+ "No OffsetMap for $this");
OffsetMap map = _offsetMap!;
_offsetMap = null;
return map;
@@ -206,6 +208,7 @@
TypeParameterScopeKind kind, String? name) {
assert(
currentTypeParameterScopeBuilder.kind == kind,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration. "
"Trying to end a ${currentTypeParameterScopeBuilder.kind} as a $kind.");
assert(
@@ -216,6 +219,7 @@
currentTypeParameterScopeBuilder.name ==
UnnamedExtensionName.unnamedExtensionSentinel) ||
identical(name, "<syntax-error>"),
+ // Coverage-ignore(suite): Not run.
"${name} != ${currentTypeParameterScopeBuilder.name}");
TypeParameterScopeBuilder previous = currentTypeParameterScopeBuilder;
currentTypeParameterScopeBuilder = currentTypeParameterScopeBuilder.parent!;
@@ -248,7 +252,9 @@
@override
SourceLibraryBuilder get libraryBuilder {
- assert(_libraryBuilder != null,
+ assert(
+ _libraryBuilder != null,
+ // Coverage-ignore(suite): Not run.
"Library builder for $this has not been computed yet.");
return _libraryBuilder!;
}
@@ -282,7 +288,10 @@
@override
void addProblemAtAccessors(Message message) {
if (accessProblem == null) {
- if (accessors.isEmpty && loader.roots.contains(this.importUri)) {
+ if (accessors.isEmpty &&
+ // Coverage-ignore(suite): Not run.
+ loader.roots.contains(this.importUri)) {
+ // Coverage-ignore-block(suite): Not run.
// This is the entry point library, and nobody access it directly. So
// we need to report a problem.
loader.addProblem(message, -1, 1, null);
@@ -357,20 +366,25 @@
CompilationUnit accessor, int charOffset, int length, Uri fileUri) {
accessors.add(new LibraryAccess(accessor, fileUri, charOffset, length));
if (accessProblem != null) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(accessProblem!, charOffset, length, fileUri);
}
}
@override
OutlineBuilder createOutlineBuilder() {
- assert(_offsetMap == null, "OffsetMap has already been set for $this");
+ assert(
+ _offsetMap == null, // Coverage-ignore(suite): Not run.
+ "OffsetMap has already been set for $this");
return new OutlineBuilder(
this, this, this, _offsetMap = new OffsetMap(fileUri));
}
@override
SourceLibraryBuilder createLibrary() {
- assert(_libraryBuilder == null,
+ assert(
+ _libraryBuilder == null,
+ // Coverage-ignore(suite): Not run.
"Source library builder as already been created for $this.");
_libraryBuilder = _sourceLibraryBuilder;
return _sourceLibraryBuilder;
@@ -576,8 +590,11 @@
// Language versions have to match. Except if (at least) one of them is
// invalid in which case we've already gotten an error about this.
if (parentCompilationUnit.languageVersion != part.languageVersion &&
+ // Coverage-ignore(suite): Not run.
parentCompilationUnit.languageVersion.valid &&
+ // Coverage-ignore(suite): Not run.
part.languageVersion.valid) {
+ // Coverage-ignore-block(suite): Not run.
// This is an error, but the part is not removed from the list of
// parts, so that metadata annotations can be associated with it.
List<LocatedMessage> context = <LocatedMessage>[];
@@ -702,7 +719,8 @@
@override
void validatePart(SourceLibraryBuilder? library, Set<Uri>? usedParts) {
- _libraryBuilder = library ?? _sourceLibraryBuilder;
+ _libraryBuilder = library ?? // Coverage-ignore(suite): Not run.
+ _sourceLibraryBuilder;
if (library != null && _parts.isNotEmpty) {
// If [library] is null, we have already reported a problem that this
// part is orphaned.
@@ -720,6 +738,7 @@
}
_parts.clear();
if (exporters.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
List<LocatedMessage> context = <LocatedMessage>[
messagePartExportContext.withLocation(fileUri, -1, 1),
];
@@ -818,6 +837,7 @@
addProblem(messageUnsupportedDartExt, charOffset, noLength, fileUri);
String strippedUri = uri.substring(nativeExtensionScheme.length);
if (strippedUri.startsWith("package")) {
+ // Coverage-ignore-block(suite): Not run.
resolvedUri = _sourceLibraryBuilder.resolve(this.importUri, strippedUri,
uriOffset + nativeExtensionScheme.length);
resolvedUri = loader.target.translateUri(resolvedUri);
@@ -853,6 +873,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void addSyntheticImport(
{required String uri,
required String? prefix,
@@ -877,6 +898,7 @@
bool explicitCoreImport = _sourceLibraryBuilder == loader.coreLibrary;
for (Import import in imports) {
if (import.importedCompilationUnit?.isPart ?? false) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(
templatePartOfInLibrary
.withArguments(import.importedCompilationUnit!.fileUri),
@@ -926,6 +948,7 @@
int charOffset,
int uriOffset) {
if (configurations != null) {
+ // Coverage-ignore-block(suite): Not run.
for (Configuration config in configurations) {
if (loader.getLibrarySupportValue(config.dottedName) ==
config.condition) {
@@ -1070,6 +1093,7 @@
if (typeVariablesByName != null) {
NominalVariableBuilder? tv = typeVariablesByName[name];
if (tv != null) {
+ // Coverage-ignore-block(suite): Not run.
enumBuilder.addProblem(
templateConflictsWithTypeVariable.withArguments(name),
member.charOffset,
@@ -1419,6 +1443,7 @@
return typeVariableNames!.contains(declaration.name);
}
if (declaration is StructuralVariableBuilder) {
+ // Coverage-ignore-block(suite): Not run.
return typeVariableNames!.contains(declaration.name);
}
@@ -1460,6 +1485,7 @@
}
}
if (namedFields != null) {
+ // Coverage-ignore-block(suite): Not run.
for (RecordTypeFieldBuilder fieldBuilder in namedFields) {
if (usesTypeVariables(fieldBuilder.type)) {
return true;
@@ -1702,6 +1728,7 @@
if (typeVariablesByName != null) {
NominalVariableBuilder? tv = typeVariablesByName[name];
if (tv != null) {
+ // Coverage-ignore-block(suite): Not run.
extensionBuilder.addProblem(
templateConflictsWithTypeVariable.withArguments(name),
member.charOffset,
@@ -1804,6 +1831,7 @@
if (typeVariablesByName != null) {
NominalVariableBuilder? tv = typeVariablesByName[name];
if (tv != null) {
+ // Coverage-ignore-block(suite): Not run.
extensionTypeDeclarationBuilder.addProblem(
templateConflictsWithTypeVariable.withArguments(name),
member.charOffset,
@@ -2083,7 +2111,10 @@
isInstanceMember: false,
libraryName: indexedLibrary != null
? new LibraryName(
- (_indexedContainer ?? indexedLibrary)!.library.reference)
+ (_indexedContainer ?? // Coverage-ignore(suite): Not run.
+ indexedLibrary)!
+ .library
+ .reference)
: libraryName);
Reference? constructorReference;
@@ -2098,6 +2129,7 @@
.getConstructorMemberName(procedureName, isTearOff: true)
.name);
} else if (indexedLibrary != null) {
+ // Coverage-ignore-block(suite): Not run.
constructorReference = indexedLibrary!.lookupGetterReference(
procedureNameScheme
.getConstructorMemberName(procedureName, isTearOff: false)
@@ -2526,7 +2558,9 @@
bool hasSuper,
int charOffset,
Token? initializerToken) {
- assert(!hasThis || !hasSuper,
+ assert(
+ !hasThis || !hasSuper,
+ // Coverage-ignore(suite): Not run.
"Formal parameter '${name}' has both 'this' and 'super' prefixes.");
if (hasThis) {
modifiers |= initializingFormalMask;
@@ -2551,6 +2585,7 @@
int charOffset,
{required InstanceTypeVariableAccessState instanceTypeVariableAccess}) {
if (_sourceLibraryBuilder._omittedTypeDeclarationBuilders != null) {
+ // Coverage-ignore-block(suite): Not run.
Builder? builder =
_sourceLibraryBuilder._omittedTypeDeclarationBuilders[typeName.name];
if (builder is OmittedTypeDeclarationBuilder) {
@@ -2615,6 +2650,7 @@
if (tv.isWildcard) continue;
StructuralVariableBuilder? existing = typeVariablesByName[tv.name];
if (existing != null) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(messageTypeVariableDuplicatedName, tv.charOffset,
tv.name.length, fileUri,
context: [
@@ -2626,6 +2662,7 @@
} else {
typeVariablesByName[tv.name] = tv;
if (owner is ClassBuilder) {
+ // Coverage-ignore-block(suite): Not run.
// Only classes and type variables can't have the same name. See
// [#29555](https://github.com/dart-lang/sdk/issues/29555).
if (tv.name == owner.name) {
@@ -2722,10 +2759,15 @@
tv.charOffset, tv.name.length, fileUri);
}
case TypeAliasBuilder():
+ // Coverage-ignore(suite): Not run.
case NominalVariableBuilder():
+ // Coverage-ignore(suite): Not run.
case StructuralVariableBuilder():
+ // Coverage-ignore(suite): Not run.
case InvalidTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
}
@@ -2751,8 +2793,11 @@
bound: variable.bound
?.clone(newTypes, _sourceLibraryBuilder, declaration),
kind: kind,
- variableVariance:
- variable.parameter.isLegacyCovariant ? null : variable.variance,
+ variableVariance: variable.parameter.isLegacyCovariant
+ ? null
+ :
+ // Coverage-ignore(suite): Not run.
+ variable.variance,
isWildcard: variable.isWildcard);
copy.add(newVariable);
unboundNominalVariables.add(newVariable);
@@ -2764,6 +2809,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
List<MetadataBuilder>? get metadata => _sourceLibraryBuilder.metadata;
@override
@@ -2862,6 +2908,7 @@
other = declaration;
}
if (deferred != null) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(templateDeferredPrefixDuplicated.withArguments(name),
deferred.charOffset, noLength, fileUri,
context: [
@@ -2933,7 +2980,9 @@
// alternative is to share these mixin applications. This situation can
// happen if you have `class A extends Object with Mixin {}` and `class B
// extends Object with Mixin {}` in the same library.
- return !existing.isMixinApplication || !other.isMixinApplication;
+ return !existing.isMixinApplication ||
+ // Coverage-ignore(suite): Not run.
+ !other.isMixinApplication;
}
return true;
}
@@ -2961,6 +3010,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void clearExtensionsInScopeCache() {
_extensionsInScope = null;
}
@@ -2993,6 +3043,7 @@
unboundTypes: unboundTypes,
unboundTypeVariables: unboundTypeVariables);
for (NamedTypeBuilder unboundType in unboundTypes) {
+ // Coverage-ignore-block(suite): Not run.
currentTypeParameterScopeBuilder
.registerUnresolvedNamedType(unboundType);
}
@@ -3129,6 +3180,7 @@
processSourceMemberBuilder(member,
inErrorRecovery: issues.isNotEmpty);
} else {
+ // Coverage-ignore-block(suite): Not run.
assert(false,
"Unexpected extension member $member (${member.runtimeType}).");
}
@@ -3154,6 +3206,7 @@
processSourceMemberBuilder(member,
inErrorRecovery: issues.isNotEmpty);
} else {
+ // Coverage-ignore-block(suite): Not run.
assert(
false,
"Unexpected extension type member "
@@ -3163,8 +3216,11 @@
} else {
assert(
declaration is PrefixBuilder ||
+ // Coverage-ignore(suite): Not run.
declaration is DynamicTypeDeclarationBuilder ||
+ // Coverage-ignore(suite): Not run.
declaration is NeverTypeDeclarationBuilder,
+ // Coverage-ignore(suite): Not run.
"Unexpected top level member $declaration "
"(${declaration.runtimeType}).");
}
@@ -3263,6 +3319,7 @@
TypeDeclarationBuilder? declaration = bound.declaration;
// TODO(cstefantsova): Unalias beyond the first layer for the check.
if (declaration is TypeAliasBuilder) {
+ // Coverage-ignore-block(suite): Not run.
TypeBuilder? rhsType = declaration.type;
if (rhsType is FunctionTypeBuilder &&
rhsType.typeVariables != null &&
@@ -3327,6 +3384,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): Avoid using [_sourceLibraryBuilder.library] here.
Uri get originImportUri => _sourceLibraryBuilder.library.importUri;
}
@@ -3349,6 +3407,7 @@
final Uri? _packageUri;
+ // Coverage-ignore(suite): Not run.
Uri? get packageUriForTesting => _packageUri;
@override
@@ -3399,7 +3458,11 @@
// A library to use for Names generated when compiling code in this library.
// This allows code generated in one library to use the private namespace of
// another, for example during expression compilation (debugging).
- Library get nameOrigin => _nameOrigin?.library ?? library;
+ Library get nameOrigin =>
+ _nameOrigin
+ // Coverage-ignore(suite): Not run.
+ ?.library ??
+ library;
@override
LibraryBuilder get nameOriginBuilder => _nameOrigin ?? this;
@@ -3526,11 +3589,14 @@
assert(
_packageUri == null ||
!importUri.isScheme('package') ||
+ // Coverage-ignore(suite): Not run.
importUri.path.startsWith(_packageUri.path),
+ // Coverage-ignore(suite): Not run.
"Foreign package uri '$_packageUri' set on library with import uri "
"'${importUri}'.");
assert(
!importUri.isScheme('dart') || _packageUri == null,
+ // Coverage-ignore(suite): Not run.
"Package uri '$_packageUri' set on dart: library with import uri "
"'${importUri}'.");
compilationUnit =
@@ -3580,6 +3646,7 @@
}
} else {
if (feature.flag.isEnabledByDefault) {
+ // Coverage-ignore-block(suite): Not run.
if (languageVersion.version < feature.enabledVersion) {
message =
templateExperimentDisabledInvalidLanguageVersion.withArguments(
@@ -3657,10 +3724,12 @@
bool get isPart => partOfName != null || partOfUri != null;
@override
+ // Coverage-ignore(suite): Not run.
Iterator<T> fullMemberIterator<T extends Builder>() =>
new SourceLibraryBuilderMemberIterator<T>(this, includeDuplicates: false);
@override
+ // Coverage-ignore(suite): Not run.
NameIterator<T> fullMemberNameIterator<T extends Builder>() =>
new SourceLibraryBuilderMemberNameIterator<T>(this,
includeDuplicates: false);
@@ -3670,14 +3739,19 @@
_augmentationLibraries;
void addAugmentationLibrary(SourceLibraryBuilder augmentationLibrary) {
- assert(augmentationLibrary.isAugmenting,
+ assert(
+ augmentationLibrary.isAugmenting,
+ // Coverage-ignore(suite): Not run.
"Library ${augmentationLibrary} must be a augmentation library.");
- assert(!augmentationLibrary.isPart,
+ assert(
+ !augmentationLibrary.isPart,
+ // Coverage-ignore(suite): Not run.
"Augmentation library ${augmentationLibrary} cannot be a part .");
(_augmentationLibraries ??= []).add(augmentationLibrary);
augmentationLibrary.augmentationIndex = _augmentationLibraries!.length;
}
+ // Coverage-ignore(suite): Not run.
/// Creates a synthesized augmentation library for the [source] code and
/// attach it as an augmentation library of this library.
///
@@ -3740,6 +3814,7 @@
LanguageVersion get languageVersion {
assert(
_languageVersion.isFinal,
+ // Coverage-ignore(suite): Not run.
"Attempting to read the language version of ${this} before has been "
"finalized.");
return _languageVersion;
@@ -3769,6 +3844,7 @@
assert(!_languageVersion.isFinal);
if (version > loader.target.currentSdkVersion) {
+ // Coverage-ignore-block(suite): Not run.
// If trying to set a language version that is higher than the current sdk
// version it's an error.
addPostponedProblem(
@@ -3802,6 +3878,7 @@
// TODO(johnniwinther): Move this to [SourceCompilationUnitImpl].
Uri resolve(Uri baseUri, String? uri, int uriOffset, {isPart = false}) {
if (uri == null) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(messageExpectedUri, uriOffset, noLength, fileUri);
return new Uri(scheme: MALFORMED_URI_SCHEME);
}
@@ -3812,12 +3889,19 @@
// Point to position in string indicated by the exception,
// or to the initial quote if no position is given.
// (Assumes the directive is using a single-line string.)
- addProblem(templateCouldNotParseUri.withArguments(uri, e.message),
- uriOffset + 1 + (e.offset ?? -1), 1, fileUri);
+ addProblem(
+ templateCouldNotParseUri.withArguments(uri, e.message),
+ uriOffset +
+ 1 +
+ (e.offset ?? // Coverage-ignore(suite): Not run.
+ -1),
+ 1,
+ fileUri);
return new Uri(
scheme: MALFORMED_URI_SCHEME, query: Uri.encodeQueryComponent(uri));
}
if (isPart && baseUri.isScheme("dart")) {
+ // Coverage-ignore-block(suite): Not run.
// Resolve using special rules for dart: URIs
return resolveRelativeUri(baseUri, parsedUri);
} else {
@@ -3826,6 +3910,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Iterable<Uri> get dependencies sync* {
yield* compilationUnit.dependencies;
for (SourceCompilationUnit part in parts) {
@@ -3952,10 +4037,12 @@
if (unserializableExports != null) {
Name fieldName = new Name(unserializableExportName, library);
- Reference? fieldReference =
- indexedLibrary?.lookupFieldReference(fieldName);
- Reference? getterReference =
- indexedLibrary?.lookupGetterReference(fieldName);
+ Reference? fieldReference = indexedLibrary
+ // Coverage-ignore(suite): Not run.
+ ?.lookupFieldReference(fieldName);
+ Reference? getterReference = indexedLibrary
+ // Coverage-ignore(suite): Not run.
+ ?.lookupGetterReference(fieldName);
library.addField(new Field.immutable(fieldName,
initializer: new StringLiteral(jsonEncode(unserializableExports)),
isStatic: true,
@@ -4017,14 +4104,20 @@
builder.message.problemMessage;
case BuiltinTypeDeclarationBuilder():
if (builder is DynamicTypeDeclarationBuilder) {
- assert(name == 'dynamic',
+ assert(
+ name == 'dynamic',
+ // Coverage-ignore(suite): Not run.
"Unexpected export name for 'dynamic': '$name'");
(unserializableExports ??= {})[name] = exportDynamicSentinel;
} else if (builder is NeverTypeDeclarationBuilder) {
- assert(name == 'Never',
+ assert(
+ name == 'Never',
+ // Coverage-ignore(suite): Not run.
"Unexpected export name for 'Never': '$name'");
- (unserializableExports ??= {})[name] = exportNeverSentinel;
+ (unserializableExports ??= // Coverage-ignore(suite): Not run.
+ {})[name] = exportNeverSentinel;
}
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case NominalVariableBuilder():
@@ -4257,6 +4350,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
String get fullNameForErrors {
// TODO(ahe): Consider if we should use relativizeUri here. The downside to
// doing that is that this URI may be used in an error message. Ideally, we
@@ -4284,6 +4378,7 @@
final Uri importUri;
@override
+ // Coverage-ignore(suite): Not run.
void becomeCoreLibrary() {
if (scope.lookupLocalMember("dynamic", setter: false) == null) {
addBuilder("dynamic",
@@ -4309,7 +4404,9 @@
}
void registerInferableType(InferableType inferableType) {
- assert(_inferableTypes != null,
+ assert(
+ _inferableTypes != null,
+ // Coverage-ignore(suite): Not run.
"Late registration of inferable type $inferableType.");
_inferableTypes?.add(inferableType);
}
@@ -4336,6 +4433,7 @@
void addPostponedProblem(
Message message, int charOffset, int length, Uri fileUri) {
if (postponedProblemsIssued) {
+ // Coverage-ignore-block(suite): Not run.
addProblem(message, charOffset, length, fileUri);
} else {
postponedProblems ??= <PostponedProblem>[];
@@ -4548,8 +4646,11 @@
} else {
assert(
declaration is PrefixBuilder ||
+ // Coverage-ignore(suite): Not run.
declaration is DynamicTypeDeclarationBuilder ||
+ // Coverage-ignore(suite): Not run.
declaration is NeverTypeDeclarationBuilder,
+ // Coverage-ignore(suite): Not run.
"Unexpected builder in library: ${declaration} "
"(${declaration.runtimeType}");
}
@@ -4611,6 +4712,7 @@
required BuiltMemberKind kind}) {
_addMemberToLibrary(declaration, member);
if (tearOff != null) {
+ // Coverage-ignore-block(suite): Not run.
_addMemberToLibrary(declaration, tearOff);
}
});
@@ -4622,7 +4724,9 @@
} else if (declaration is PrefixBuilder) {
// Ignored. Kernel doesn't represent prefixes.
return;
- } else if (declaration is BuiltinTypeDeclarationBuilder) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (declaration is BuiltinTypeDeclarationBuilder) {
// Nothing needed.
return;
} else {
@@ -4636,6 +4740,7 @@
member.isStatic = true;
if (!declaration.isAugmenting && !declaration.isDuplicate) {
if (declaration.isConflictingAugmentationMember) {
+ // Coverage-ignore-block(suite): Not run.
member.name = new Name(
'${member.name.text}'
'#${declaration.libraryBuilder.augmentationIndex}',
@@ -4672,6 +4777,7 @@
constructor.member as Constructor, arguments)
..isConst = true;
} else {
+ // Coverage-ignore-block(suite): Not run.
annotation =
new StaticInvocation(constructor.member as Procedure, arguments)
..isConst = true;
@@ -4695,10 +4801,12 @@
if (declaration is InvalidTypeDeclarationBuilder) return declaration;
if (other is InvalidTypeDeclarationBuilder) return other;
if (declaration is AccessErrorBuilder) {
+ // Coverage-ignore-block(suite): Not run.
AccessErrorBuilder error = declaration;
declaration = error.builder;
}
if (other is AccessErrorBuilder) {
+ // Coverage-ignore-block(suite): Not run.
AccessErrorBuilder error = other;
other = error.builder;
}
@@ -4724,7 +4832,11 @@
return preferred;
}
if (declaration.next == null && other.next == null) {
- if (isImport && declaration is PrefixBuilder && other is PrefixBuilder) {
+ if (isImport &&
+ declaration is PrefixBuilder &&
+ // Coverage-ignore(suite): Not run.
+ other is PrefixBuilder) {
+ // Coverage-ignore-block(suite): Not run.
// Handles the case where the same prefix is used for different
// imports.
return declaration
@@ -4872,8 +4984,11 @@
StructuralVariableBuilder newVariable = new StructuralVariableBuilder(
variable.name, this, variable.charOffset, variable.fileUri,
bound: variable.bound?.clone(newTypes, this, declaration),
- variableVariance:
- variable.parameter.isLegacyCovariant ? null : variable.variance,
+ variableVariance: variable.parameter.isLegacyCovariant
+ ? null
+ :
+ // Coverage-ignore(suite): Not run.
+ variable.variance,
isWildcard: variable.isWildcard);
copy.add(newVariable);
unboundStructuralVariables.add(newVariable);
@@ -4973,6 +5088,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
void setBoundAndDefaultType(
/* TypeParameterType | StructuralParameterType */ type,
DartType bound,
@@ -5005,13 +5121,17 @@
new List<DartType?>.filled(_pendingNullabilities.length, null);
int stackTop = 0;
for (PendingNullability pendingNullability in _pendingNullabilities) {
- if (typeFilter != null && !typeFilter.contains(pendingNullability.type)) {
+ if (typeFilter != null &&
+ // Coverage-ignore(suite): Not run.
+ !typeFilter.contains(pendingNullability.type)) {
continue;
}
nullabilityMap[pendingNullability.type] = null;
}
for (PendingNullability pendingNullability in _pendingNullabilities) {
- if (typeFilter != null && !typeFilter.contains(pendingNullability.type)) {
+ if (typeFilter != null &&
+ // Coverage-ignore(suite): Not run.
+ !typeFilter.contains(pendingNullability.type)) {
continue;
}
DartType type = pendingNullability.type;
@@ -5038,6 +5158,7 @@
if (getDeclaredNullability(next) == marker) {
setDeclaredNullability(next, Nullability.undetermined);
if (isDirectDependency) {
+ // Coverage-ignore-block(suite): Not run.
// The dependency error is reported elsewhere.
setBoundAndDefaultType(
current, const InvalidType(), const InvalidType());
@@ -5055,6 +5176,7 @@
setDeclaredNullability(current, computeNullabilityFromBound(current));
}
} else if (peeledBound is StructuralParameterType) {
+ // Coverage-ignore-block(suite): Not run.
DartType current = type;
DartType? next = peeledBound;
bool isDirectDependency = identical(getBound(type), peeledBound);
@@ -5142,6 +5264,7 @@
if (!isAugmenting) return;
if (languageVersion != origin.languageVersion) {
+ // Coverage-ignore-block(suite): Not run.
List<LocatedMessage> context = <LocatedMessage>[];
if (origin.languageVersion.isExplicit) {
context.add(messageLanguageVersionLibraryContext.withLocation(
@@ -5191,6 +5314,7 @@
required BuiltMemberKind kind}) {
_addMemberToLibrary(builder, member);
if (tearOff != null) {
+ // Coverage-ignore-block(suite): Not run.
_addMemberToLibrary(builder, tearOff);
}
});
@@ -5203,12 +5327,15 @@
count +=
builder.buildBodyNodes(addMembersToLibrary: !builder.isDuplicate);
} else if (builder is SourceClassBuilder) {
+ // Coverage-ignore-block(suite): Not run.
count += builder.buildBodyNodes();
} else if (builder is SourceTypeAliasBuilder) {
// Do nothing.
} else if (builder is PrefixBuilder) {
// Ignored. Kernel doesn't represent prefixes.
- } else if (builder is BuiltinTypeDeclarationBuilder) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (builder is BuiltinTypeDeclarationBuilder) {
// Nothing needed.
} else {
unhandled("${builder.runtimeType}", "buildBodyNodes",
@@ -5302,6 +5429,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
void reportTypeArgumentIssue(Message message, Uri fileUri, int fileOffset,
{TypeParameter? typeParameter,
DartType? superBoundedAttempt,
@@ -5346,9 +5474,11 @@
noLength));
}
if (superBoundedAttemptInverted != null && superBoundedAttempt != null) {
- (context ??= <LocatedMessage>[]).add(templateSuperBoundedHint
- .withArguments(superBoundedAttempt, superBoundedAttemptInverted)
- .withLocation(fileUri, fileOffset, noLength));
+ (context ??= // Coverage-ignore(suite): Not run.
+ <LocatedMessage>[])
+ .add(templateSuperBoundedHint
+ .withArguments(superBoundedAttempt, superBoundedAttemptInverted)
+ .withLocation(fileUri, fileOffset, noLength));
}
addProblem(message, fileOffset, noLength, fileUri, context: context);
}
@@ -5491,6 +5621,7 @@
if (issues.isNotEmpty) {
DartType? targetReceiver;
if (klass != null) {
+ // Coverage-ignore-block(suite): Not run.
targetReceiver =
new InterfaceType(klass, klass.enclosingLibrary.nonNullable);
}
@@ -5686,7 +5817,9 @@
} else {
assert(
declaration is! TypeDeclarationBuilder ||
+ // Coverage-ignore(suite): Not run.
declaration is BuiltinTypeDeclarationBuilder,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration ${declaration.runtimeType}");
}
}
@@ -5733,7 +5866,9 @@
new InvalidTypeDeclarationBuilder(
typeVariable.name,
message.withLocation(
- dependency.typeVariableBoundOfItself.fileUri ?? fileUri,
+ dependency.typeVariableBoundOfItself
+ .fileUri ?? // Coverage-ignore(suite): Not run.
+ fileUri,
dependency.typeVariableBoundOfItself.charOffset,
dependency.typeVariableBoundOfItself.name.length)));
}
@@ -5757,6 +5892,7 @@
compilationUnit.forEachExtensionInScope(f);
}
+ // Coverage-ignore(suite): Not run.
void clearExtensionsInScopeCache() {
compilationUnit.clearExtensionsInScopeCache();
}
@@ -5864,6 +6000,7 @@
case TypeUse.macroTypeArgument:
case TypeUse.typeParameterDefaultType:
case TypeUse.defaultTypeAsTypeArgument:
+ // Coverage-ignore(suite): Not run.
case TypeUse.deferredTypeError:
break;
}
@@ -5919,6 +6056,7 @@
augmentationLibraryDelayedDefaultValueCloners =
augmentationLibrary.installTypedefTearOffs();
if (augmentationLibraryDelayedDefaultValueCloners != null) {
+ // Coverage-ignore-block(suite): Not run.
(delayedDefaultValueCloners ??= [])
.addAll(augmentationLibraryDelayedDefaultValueCloners);
}
@@ -6013,6 +6151,7 @@
return new ClassName(name);
case TypeParameterScopeKind.extensionDeclaration:
return extensionName;
+ // Coverage-ignore(suite): Not run.
case TypeParameterScopeKind.typedef:
case TypeParameterScopeKind.staticMethod:
case TypeParameterScopeKind.instanceMethod:
@@ -6041,6 +6180,7 @@
return ContainerType.Extension;
case TypeParameterScopeKind.extensionTypeDeclaration:
return ContainerType.ExtensionType;
+ // Coverage-ignore(suite): Not run.
case TypeParameterScopeKind.typedef:
case TypeParameterScopeKind.staticMethod:
case TypeParameterScopeKind.instanceMethod:
@@ -6139,7 +6279,9 @@
/// given [name] and [typeVariables] located [charOffset].
void markAsClassDeclaration(String name, int charOffset,
List<NominalVariableBuilder>? typeVariables) {
- assert(_kind == TypeParameterScopeKind.classOrNamedMixinApplication,
+ assert(
+ _kind == TypeParameterScopeKind.classOrNamedMixinApplication,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration kind: $_kind");
_kind = TypeParameterScopeKind.classDeclaration;
_name = name;
@@ -6151,7 +6293,9 @@
/// with the given [name] and [typeVariables] located [charOffset].
void markAsNamedMixinApplication(String name, int charOffset,
List<NominalVariableBuilder>? typeVariables) {
- assert(_kind == TypeParameterScopeKind.classOrNamedMixinApplication,
+ assert(
+ _kind == TypeParameterScopeKind.classOrNamedMixinApplication,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration kind: $_kind");
_kind = TypeParameterScopeKind.namedMixinApplication;
_name = name;
@@ -6166,7 +6310,9 @@
// TODO(johnniwinther): Avoid using 'classOrNamedMixinApplication' for mixin
// declaration. These are syntactically distinct so we don't need the
// transition.
- assert(_kind == TypeParameterScopeKind.classOrNamedMixinApplication,
+ assert(
+ _kind == TypeParameterScopeKind.classOrNamedMixinApplication,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration kind: $_kind");
_kind = TypeParameterScopeKind.mixinDeclaration;
_name = name;
@@ -6178,7 +6324,9 @@
/// the given [name] and [typeVariables] located [charOffset].
void markAsExtensionDeclaration(String? name, int charOffset,
List<NominalVariableBuilder>? typeVariables) {
- assert(_kind == TypeParameterScopeKind.extensionOrExtensionTypeDeclaration,
+ assert(
+ _kind == TypeParameterScopeKind.extensionOrExtensionTypeDeclaration,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration kind: $_kind");
_kind = TypeParameterScopeKind.extensionDeclaration;
_extensionName = name != null
@@ -6193,7 +6341,9 @@
/// with the given [name] and [typeVariables] located [charOffset].
void markAsExtensionTypeDeclaration(String name, int charOffset,
List<NominalVariableBuilder>? typeVariables) {
- assert(_kind == TypeParameterScopeKind.extensionOrExtensionTypeDeclaration,
+ assert(
+ _kind == TypeParameterScopeKind.extensionOrExtensionTypeDeclaration,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration kind: $_kind");
_kind = TypeParameterScopeKind.extensionTypeDeclaration;
_name = name;
@@ -6205,7 +6355,9 @@
/// the given [name] and [typeVariables] located [charOffset].
void markAsEnumDeclaration(String name, int charOffset,
List<NominalVariableBuilder>? typeVariables) {
- assert(_kind == TypeParameterScopeKind.enumDeclaration,
+ assert(
+ _kind == TypeParameterScopeKind.enumDeclaration,
+ // Coverage-ignore(suite): Not run.
"Unexpected declaration kind: $_kind");
_name = name;
_charOffset = charOffset;
@@ -6217,7 +6369,9 @@
///
/// See [extensionThisType] for terminology.
void registerExtensionThisType(TypeBuilder type) {
- assert(_kind == TypeParameterScopeKind.extensionDeclaration,
+ assert(
+ _kind == TypeParameterScopeKind.extensionDeclaration,
+ // Coverage-ignore(suite): Not run.
"DeclarationBuilder.registerExtensionThisType is not supported $_kind");
assert(_extensionThisType == null,
"Extension this type has already been set.");
@@ -6257,9 +6411,13 @@
/// The 'extension this type' is the type if `this` expression in instance
/// methods declared in extension declarations.
TypeBuilder get extensionThisType {
- assert(kind == TypeParameterScopeKind.extensionDeclaration,
+ assert(
+ kind == TypeParameterScopeKind.extensionDeclaration,
+ // Coverage-ignore(suite): Not run.
"DeclarationBuilder.extensionThisType not supported on $kind.");
- assert(_extensionThisType != null,
+ assert(
+ _extensionThisType != null,
+ // Coverage-ignore(suite): Not run.
"DeclarationBuilder.extensionThisType has not been set on $this.");
return _extensionThisType!;
}
@@ -6343,6 +6501,7 @@
String name = qualifier ?? typeName.name;
Builder? declaration;
if (members != null) {
+ // Coverage-ignore-block(suite): Not run.
declaration = members![name];
}
if (declaration == null && map != null) {
@@ -6353,6 +6512,7 @@
// parent declaration.
parent!.registerUnresolvedNamedType(namedTypeBuilder);
} else if (qualifier != null) {
+ // Coverage-ignore-block(suite): Not run.
// Attempt to use a member or type variable as a prefix.
int nameOffset = typeName.fullNameOffset;
int nameLength = typeName.fullNameLength;
@@ -6376,6 +6536,7 @@
Scope toScope(Scope? parent,
{Map<String, Builder>? omittedTypeDeclarationBuilders}) {
+ // Coverage-ignore(suite): Not run.
if (omittedTypeDeclarationBuilders != null &&
omittedTypeDeclarationBuilders.isNotEmpty) {
parent = new Scope(
@@ -6465,6 +6626,7 @@
bool get isExplicit => true;
+ // Coverage-ignore(suite): Not run.
bool get valid => true;
@override
@@ -6503,6 +6665,7 @@
this.version, this.isExplicit);
@override
+ // Coverage-ignore(suite): Not run.
bool get valid => false;
@override
@@ -6530,15 +6693,19 @@
ImplicitLanguageVersion(this.version);
@override
+ // Coverage-ignore(suite): Not run.
bool get valid => true;
@override
+ // Coverage-ignore(suite): Not run.
Uri? get fileUri => null;
@override
+ // Coverage-ignore(suite): Not run.
int get charOffset => -1;
@override
+ // Coverage-ignore(suite): Not run.
int get charCount => noLength;
@override
@@ -6598,6 +6765,7 @@
LibraryAccess(this.accessor, this.fileUri, this.charOffset, this.length);
}
+// Coverage-ignore(suite): Not run.
class SourceLibraryBuilderMemberIterator<T extends Builder>
implements Iterator<T> {
Iterator<T>? _iterator;
@@ -6647,6 +6815,7 @@
T get current => _iterator?.current ?? (throw new StateError('No element'));
}
+// Coverage-ignore(suite): Not run.
class SourceLibraryBuilderMemberNameIterator<T extends Builder>
implements NameIterator<T> {
NameIterator<T>? _iterator;
diff --git a/pkg/front_end/lib/src/source/source_loader.dart b/pkg/front_end/lib/src/source/source_loader.dart
index 7bd8d3d..12b02c3 100644
--- a/pkg/front_end/lib/src/source/source_loader.dart
+++ b/pkg/front_end/lib/src/source/source_loader.dart
@@ -190,6 +190,7 @@
/// This is used for [hasSeenError].
bool _hasSeenError = false;
+ // Coverage-ignore(suite): Not run.
/// Clears the [seenMessages] and [hasSeenError] state.
void resetSeenMessages() {
seenMessages.clear();
@@ -233,8 +234,11 @@
Set<ClassBuilder> _macroDeclarations = {};
SourceLoader(this.fileSystem, this.includeComments, this.target)
- : dataForTesting =
- retainDataForTesting ? new SourceLoaderDataForTesting() : null;
+ : dataForTesting = retainDataForTesting
+ ?
+ // Coverage-ignore(suite): Not run.
+ new SourceLoaderDataForTesting()
+ : null;
bool containsLoadedLibraryBuilder(Uri importUri) =>
lookupLoadedLibraryBuilder(importUri) != null;
@@ -246,6 +250,7 @@
CompilationUnit? lookupCompilationUnit(Uri importUri) =>
_compilationUnits[importUri];
+ // Coverage-ignore(suite): Not run.
CompilationUnit? lookupCompilationUnitByFileUri(Uri fileUri) {
// TODO(johnniwinther): Store compilation units in a map by file URI?
for (CompilationUnit compilationUnit in _compilationUnits.values) {
@@ -283,11 +288,16 @@
_sourceLibraryBuilders!.clear();
}
+ // Coverage-ignore(suite): Not run.
Iterable<Uri> get loadedLibraryImportUris => _loadedLibraryBuilders.keys;
void registerLoadedDillLibraryBuilder(DillLibraryBuilder libraryBuilder) {
- assert(!libraryBuilder.isPart, "Unexpected part $libraryBuilder.");
- assert(!libraryBuilder.isAugmenting,
+ assert(
+ !libraryBuilder.isPart, // Coverage-ignore(suite): Not run.
+ "Unexpected part $libraryBuilder.");
+ assert(
+ !libraryBuilder.isAugmenting,
+ // Coverage-ignore(suite): Not run.
"Unexpected augmenting library $libraryBuilder.");
Uri uri = libraryBuilder.importUri;
_markDartLibraries(uri, libraryBuilder, libraryBuilder.mainCompilationUnit);
@@ -295,6 +305,7 @@
_loadedLibraryBuilders[uri] = libraryBuilder;
}
+ // Coverage-ignore(suite): Not run.
LibraryBuilder? deregisterLoadedLibraryBuilder(Uri importUri) {
LibraryBuilder? libraryBuilder = _loadedLibraryBuilders.remove(importUri);
if (libraryBuilder != null) {
@@ -303,6 +314,7 @@
return libraryBuilder;
}
+ // Coverage-ignore(suite): Not run.
void clearLibraryBuilders() {
_compilationUnits.clear();
_loadedLibraryBuilders.clear();
@@ -398,8 +410,10 @@
CompilationUnit? compilationUnit = lookupCompilationUnit(uri);
// TODO(johnniwinther): Why is the dill target sometimes not loaded at this
// point? And does it matter?
- compilationUnit ??=
- target.dillTarget.loader.lookupLibraryBuilder(uri)?.mainCompilationUnit;
+ compilationUnit ??= target.dillTarget.loader
+ .lookupLibraryBuilder(uri)
+ // Coverage-ignore(suite): Not run.
+ ?.mainCompilationUnit;
return DartLibrarySupport.isDartLibrarySupported(libraryName,
libraryExists: compilationUnit != null,
isSynthetic: compilationUnit?.isSynthetic ?? true,
@@ -463,6 +477,7 @@
if (packageForLanguageVersion.languageVersion != null) {
if (packageForLanguageVersion.languageVersion
is package_config.InvalidLanguageVersion) {
+ // Coverage-ignore-block(suite): Not run.
packageLanguageVersionProblem =
messageLanguageVersionInvalidInDotPackages;
packageLanguageVersion = new InvalidLanguageVersion(
@@ -472,6 +487,7 @@
packageForLanguageVersion.languageVersion!.major,
packageForLanguageVersion.languageVersion!.minor);
if (version > target.currentSdkVersion) {
+ // Coverage-ignore-block(suite): Not run.
packageLanguageVersionProblem =
templateLanguageVersionTooHigh.withArguments(
target.currentSdkVersion.major,
@@ -518,6 +534,7 @@
Uri libraryUri = origin?.importUri ?? uri;
if (target.backendTarget.mayDefineRestrictedType(libraryUri)) {
+ // Coverage-ignore-block(suite): Not run.
libraryBuilder.mayImplementRestrictedTypes = true;
}
if (uri.isScheme("dart")) {
@@ -543,6 +560,7 @@
NonNullableByDefaultCompiledMode libraryMode =
libraryBuilder.library.nonNullableByDefaultCompiledMode;
if (libraryMode == NonNullableByDefaultCompiledMode.Invalid) {
+ // Coverage-ignore-block(suite): Not run.
registerNnbdMismatchLibrary(
libraryBuilder, messageInvalidNnbdDillLibrary);
} else {
@@ -654,6 +672,7 @@
firstLibrary, -1, noLength, firstLibrary.fileUri);
}
if (!_hasLibraryAccess(imported: uri, importer: firstLibrary?.importUri)) {
+ // Coverage-ignore-block(suite): Not run.
if (firstLibrary != null) {
firstLibrary.addProblem(messagePlatformPrivateLibraryAccess, -1,
noLength, firstLibrary.importUri);
@@ -731,7 +750,9 @@
}
void logSummary(Template<SummaryTemplate> template) {
- ticker.log((Duration elapsed, Duration sinceStart) {
+ ticker.log(
+ // Coverage-ignore(suite): Not run.
+ (Duration elapsed, Duration sinceStart) {
int libraryCount = 0;
for (CompilationUnit library in compilationUnits) {
if (library.loader == this) {
@@ -803,14 +824,18 @@
target.context.report(
fileUri != null
? message.withLocation(fileUri, charOffset, length)
- : message.withoutLocation(),
+ :
+ // Coverage-ignore(suite): Not run.
+ message.withoutLocation(),
severity,
context: context,
involvedFiles: involvedFiles);
if (severity == Severity.error) {
(wasHandled ? handledErrors : unhandledErrors).add(fileUri != null
? message.withLocation(fileUri, charOffset, length)
- : message.withoutLocation());
+ :
+ // Coverage-ignore(suite): Not run.
+ message.withoutLocation());
}
FormattedMessage formattedMessage = target.createFormattedMessage(
message, charOffset, length, fileUri, context, severity,
@@ -877,7 +902,9 @@
Future<Token> tokenize(SourceCompilationUnit compilationUnit,
{bool suppressLexicalErrors = false}) async {
- target.benchmarker?.beginSubdivide(BenchmarkSubdivides.tokenize);
+ target.benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.beginSubdivide(BenchmarkSubdivides.tokenize);
Uri fileUri = compilationUnit.fileUri;
// Lookup the file URI in the cache.
@@ -896,6 +923,7 @@
}
bytes = synthesizeSourceForMissingFile(importUri, null);
} else if (!fileUri.hasScheme) {
+ // Coverage-ignore-block(suite): Not run.
target.benchmarker?.endSubdivide();
return internalProblem(
templateInternalProblemUriMissingScheme.withArguments(fileUri),
@@ -1004,7 +1032,9 @@
}
token = token.next!;
}
- target.benchmarker?.endSubdivide();
+ target.benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
return token;
}
@@ -1039,6 +1069,7 @@
_typeInferenceEngine!.typeDependencies[member] = typeDependency;
}
+ // Coverage-ignore(suite): Not run.
/// Registers the [compilationUnit] as unparsed with the given [source] code.
///
/// This is used for creating synthesized augmentation libraries.
@@ -1108,6 +1139,7 @@
}
// We only include the [context] on the first library access.
if (compilationUnit.accessors.isEmpty) {
+ // Coverage-ignore-block(suite): Not run.
// This is the entry point library, and nobody access it directly. So
// we need to report a problem.
addProblem(message, -1, 1, null, context: context);
@@ -1145,6 +1177,7 @@
return new Uint8List.view(
bytes.buffer, bytes.offsetInBytes, bytes.length - 1);
}
+ // Coverage-ignore(suite): Not run.
return bytes.sublist(0, bytes.length - 1);
}
@@ -1184,6 +1217,7 @@
// the "real" parsing is done. This in turn means that some errors
// (e.g. missing semi-colon) will not be issued when benchmarking.
{
+ // Coverage-ignore-block(suite): Not run.
target.benchmarker?.beginSubdivide(
BenchmarkSubdivides.body_buildBody_benchmark_specific_diet_parser);
DietParser parser = new DietParser(new ForwardingListener(),
@@ -1192,6 +1226,7 @@
target.benchmarker?.endSubdivide();
}
{
+ // Coverage-ignore-block(suite): Not run.
target.benchmarker?.beginSubdivide(
BenchmarkSubdivides.body_buildBody_benchmark_specific_parser);
Parser parser = new Parser(new ForwardingListener(),
@@ -1217,6 +1252,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
Future<Expression> buildExpression(
SourceLibraryBuilder libraryBuilder,
String? enclosingClassOrExtension,
@@ -1354,6 +1390,7 @@
roots.add(part.partOfLibrary!.importUri);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
part.addProblem(messagePartOrphan, 0, 1, part.fileUri);
SourceLibraryBuilder sourceLibraryBuilder = part.createLibrary();
part.validatePart(null, null);
@@ -1370,8 +1407,11 @@
}
_sourceLibraryBuilders = sourceLibraries;
assert(
- _compilationUnits.values.every((library) =>
- !(library is SourceLibraryBuilder && library.isAugmenting)),
+ _compilationUnits.values
+ .every((library) => !(library is SourceLibraryBuilder &&
+ // Coverage-ignore(suite): Not run.
+ library.isAugmenting)),
+ // Coverage-ignore(suite): Not run.
"Augmentation library found in libraryBuilders: " +
_compilationUnits.values
.where((compilationUnit) =>
@@ -1381,12 +1421,14 @@
".");
assert(
sourceLibraries.every((library) => !library.isAugmenting),
+ // Coverage-ignore(suite): Not run.
"Augmentation library found in sourceLibraryBuilders: "
"${sourceLibraries.where((library) => library.isAugmenting)}.");
assert(
_compilationUnits.values.every((compilationUnit) =>
compilationUnit.loader != this ||
sourceLibraries.contains(compilationUnit.libraryBuilder)),
+ // Coverage-ignore(suite): Not run.
"Source library not found in sourceLibraryBuilders:" +
_compilationUnits.values
.where((compilationUnit) =>
@@ -1483,6 +1525,7 @@
}
}
+ // Coverage-ignore-block(suite): Not run.
Builder? macroClassBuilder =
macroLibraryBuilder.lookupLocalMember(macroClassName);
if (macroClassBuilder is! ClassBuilder) {
@@ -1665,13 +1708,16 @@
return null;
}
- Class? get macroClass => _macroClassBuilder?.cls;
+ Class? get macroClass => _macroClassBuilder
+ // Coverage-ignore(suite): Not run.
+ ?.cls;
Future<MacroApplications?> computeMacroApplications() async {
if (_macroClassBuilder == null) {
return null;
}
+ // Coverage-ignore-block(suite): Not run.
MacroApplications macroApplications = new MacroApplications(
this,
target.context.options.macroExecutor,
@@ -1688,6 +1734,7 @@
return null;
}
+ // Coverage-ignore(suite): Not run.
Future<void> computeAdditionalMacroApplications(
MacroApplications macroApplications,
Iterable<SourceLibraryBuilder> sourceLibraryBuilders) async {
@@ -1820,7 +1867,9 @@
/// found.
void checkObjectClassHierarchy(ClassBuilder objectClass) {
if (objectClass is SourceClassBuilder &&
+ // Coverage-ignore(suite): Not run.
objectClass.libraryBuilder.loader == this) {
+ // Coverage-ignore-block(suite): Not run.
if (objectClass.supertypeBuilder != null) {
objectClass.supertypeBuilder = null;
objectClass.addProblem(
@@ -1983,6 +2032,7 @@
bool checkEnumSupertypeIsDenylisted(SourceClassBuilder cls) {
if (!cls.libraryBuilder.libraryFeatures.enhancedEnums.isEnabled) {
+ // Coverage-ignore-block(suite): Not run.
cls.addProblem(
templateEnumSupertypeOfNonAbstractClass.withArguments(cls.name),
cls.charOffset,
@@ -2003,6 +2053,7 @@
for (int i = 0; i < directSupertypes.length; i++) {
TypeDeclarationBuilder? supertype = directSupertypes[i];
if (supertype is SourceEnumBuilder) {
+ // Coverage-ignore-block(suite): Not run.
cls.addProblem(templateExtendingEnum.withArguments(supertype.name),
cls.charOffset, noLength);
} else if (!cls.libraryBuilder.mayImplementRestrictedTypes &&
@@ -2488,7 +2539,9 @@
Set<Library> libraries = new Set<Library>();
List<Library> workList = <Library>[];
for (LibraryBuilder libraryBuilder in loadedLibraryBuilders) {
- assert(!libraryBuilder.isAugmenting,
+ assert(
+ !libraryBuilder.isAugmenting,
+ // Coverage-ignore(suite): Not run.
"Unexpected augmentation library $libraryBuilder.");
if ((libraryBuilder.loader == this ||
libraryBuilder.importUri.isScheme("dart") ||
@@ -2571,8 +2624,15 @@
Class underscoreEnumClass) {
for (SourceClassBuilder builder in sourceClasses) {
assert(builder.libraryBuilder.loader == this && !builder.isAugmenting);
- builder.checkSupertypes(coreTypes, hierarchyBuilder, objectClass,
- enumClass, underscoreEnumClass, _macroClassBuilder?.cls);
+ builder.checkSupertypes(
+ coreTypes,
+ hierarchyBuilder,
+ objectClass,
+ enumClass,
+ underscoreEnumClass,
+ _macroClassBuilder
+ // Coverage-ignore(suite): Not run.
+ ?.cls);
}
for (SourceExtensionTypeDeclarationBuilder builder
in sourceExtensionTypeDeclarations) {
@@ -2659,6 +2719,7 @@
// TODO(johnniwinther): Should the member be added to the extension
// type declaration?
break;
+ // Coverage-ignore(suite): Not run.
case ExtensionBuilder():
throw new UnsupportedError(
"Unexpected declaration ${declarationBuilder}.");
@@ -2775,12 +2836,15 @@
}
target.benchmarker
+ // Coverage-ignore(suite): Not run.
?.beginSubdivide(BenchmarkSubdivides.delayedActionPerformer);
for (DelayedActionPerformer delayedActionPerformer
in delayedActionPerformers) {
delayedActionPerformer.performDelayedActions(allowFurtherDelays: false);
}
- target.benchmarker?.endSubdivide();
+ target.benchmarker
+ // Coverage-ignore(suite): Not run.
+ ?.endSubdivide();
ticker.logMs("Build outline expressions");
}
@@ -2989,6 +3053,7 @@
LibraryBuilder? library =
lookupLoadedLibraryBuilder(kernelLibrary.importUri);
if (library == null) {
+ // Coverage-ignore-block(suite): Not run.
return target.dillTarget.loader
.computeExtensionTypeBuilderFromTargetExtensionType(extensionType);
}
@@ -3255,6 +3320,7 @@
}
""";
+// Coverage-ignore(suite): Not run.
class SourceLoaderDataForTesting {
final Map<TreeNode, TreeNode> _aliasMap = {};
diff --git a/pkg/front_end/lib/src/source/source_member_builder.dart b/pkg/front_end/lib/src/source/source_member_builder.dart
index 6279e48..35ce7d3 100644
--- a/pkg/front_end/lib/src/source/source_member_builder.dart
+++ b/pkg/front_end/lib/src/source/source_member_builder.dart
@@ -75,6 +75,7 @@
retainDataForTesting ? new MemberDataForTesting() : null;
@override
+ // Coverage-ignore(suite): Not run.
void buildOutlineNodes(BuildNodesCallback f) {
assert(false, "Unexpected call to $runtimeType.buildMembers.");
}
@@ -85,12 +86,14 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool get isAugmentation => false;
@override
bool get isConflictingAugmentationMember => false;
@override
+ // Coverage-ignore(suite): Not run.
void set isConflictingAugmentationMember(bool value) {
assert(false,
"Unexpected call to $runtimeType.isConflictingAugmentationMember=");
@@ -116,8 +119,11 @@
MemberDataForTesting? dataForTesting;
SourceMemberBuilderImpl(Builder parent, int charOffset, [Uri? fileUri])
- : dataForTesting =
- retainDataForTesting ? new MemberDataForTesting() : null,
+ : dataForTesting = retainDataForTesting
+ ?
+ // Coverage-ignore(suite): Not run.
+ new MemberDataForTesting()
+ : null,
super(parent, charOffset, fileUri);
@override
@@ -135,7 +141,9 @@
}
void set isConflictingSetter(bool value) {
- assert(_isConflictingSetter == null,
+ assert(
+ _isConflictingSetter == null,
+ // Coverage-ignore(suite): Not run.
'$this.isConflictingSetter has already been fixed.');
_isConflictingSetter = value;
}
@@ -149,22 +157,27 @@
@override
void set isConflictingAugmentationMember(bool value) {
- assert(_isConflictingAugmentationMember == null,
+ assert(
+ _isConflictingAugmentationMember == null,
+ // Coverage-ignore(suite): Not run.
'$this.isConflictingAugmentationMember has already been fixed.');
_isConflictingAugmentationMember = value;
}
// TODO(johnniwinther): Remove this and create a [ProcedureBuilder] interface.
@override
+ // Coverage-ignore(suite): Not run.
ProcedureKind? get kind => unsupported("kind", charOffset, fileUri);
@override
+ // Coverage-ignore(suite): Not run.
void buildOutlineExpressions(
ClassHierarchy classHierarchy,
List<DelayedActionPerformer> delayedActionPerformers,
List<DelayedDefaultValueCloner> delayedDefaultValueCloners) {}
@override
+ // Coverage-ignore(suite): Not run.
StringBuffer printOn(StringBuffer buffer) {
if (isClassMember) {
buffer.write(classBuilder!.name);
diff --git a/pkg/front_end/lib/src/source/source_procedure_builder.dart b/pkg/front_end/lib/src/source/source_procedure_builder.dart
index d7a4ba1..6058bb0 100644
--- a/pkg/front_end/lib/src/source/source_procedure_builder.dart
+++ b/pkg/front_end/lib/src/source/source_procedure_builder.dart
@@ -135,6 +135,7 @@
@override
Name get memberName => _memberName.name;
+ // Coverage-ignore(suite): Not run.
List<SourceProcedureBuilder>? get augmentationsForTesting => _augmentations;
@override
@@ -185,6 +186,7 @@
assert(
overriddenMembers.every((overriddenMember) =>
overriddenMember.declarationBuilder != classBuilder),
+ // Coverage-ignore(suite): Not run.
"Unexpected override dependencies for $this: $overriddenMembers");
_overrideDependencies ??= {};
_overrideDependencies!.addAll(overriddenMembers);
@@ -221,6 +223,7 @@
case ProcedureKind.Getter:
return procedure;
case ProcedureKind.Factory:
+ // Coverage-ignore(suite): Not run.
return procedure;
case ProcedureKind.Operator:
case ProcedureKind.Setter:
@@ -233,6 +236,7 @@
switch (kind) {
case ProcedureKind.Setter:
return procedure;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Method:
case ProcedureKind.Getter:
case ProcedureKind.Operator:
@@ -280,6 +284,7 @@
assert(extensionTearOff == null, "Unexpected extension tear-off.");
f(member: _procedure, kind: BuiltMemberKind.ExtensionOperator);
break;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
throw new UnsupportedError(
'Unexpected extension method kind ${kind}');
@@ -304,6 +309,7 @@
assert(extensionTearOff == null, "Unexpected extension tear-off.");
f(member: _procedure, kind: BuiltMemberKind.ExtensionTypeOperator);
break;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
f(
member: _procedure,
@@ -366,7 +372,8 @@
void _buildExtensionTearOff(SourceLibraryBuilder sourceLibraryBuilder,
SourceDeclarationBuilderMixin declarationBuilder) {
assert(
- _extensionTearOff != null, "No extension tear off created for $this.");
+ _extensionTearOff != null, // Coverage-ignore(suite): Not run.
+ "No extension tear off created for $this.");
_extensionTearOffParameterMap = {};
@@ -531,6 +538,7 @@
(_augmentations ??= []).add(augmentation);
}
} else {
+ // Coverage-ignore-block(suite): Not run.
reportAugmentationMismatch(augmentation);
}
}
@@ -543,6 +551,7 @@
Procedure declaredProcedure = targetBuilder.actualProcedure;
if (declaredProcedure.isAbstract || declaredProcedure.isExternal) {
+ // Coverage-ignore-block(suite): Not run.
return targetBuilder._augmentedBuilder != null
? _getAugmentSuperTarget(targetBuilder._augmentedBuilder!)
: null;
diff --git a/pkg/front_end/lib/src/source/source_type_alias_builder.dart b/pkg/front_end/lib/src/source/source_type_alias_builder.dart
index cc5cf50..cc5c617 100644
--- a/pkg/front_end/lib/src/source/source_type_alias_builder.dart
+++ b/pkg/front_end/lib/src/source/source_type_alias_builder.dart
@@ -174,8 +174,10 @@
typeParameters = declaration.typeVariables;
case TypeAliasBuilder():
typeParameters = declaration.typeVariables;
+ // Coverage-ignore(suite): Not run.
case ExtensionTypeDeclarationBuilder():
typeParameters = declaration.typeParameters;
+ // Coverage-ignore(suite): Not run.
case BuiltinTypeDeclarationBuilder():
case InvalidTypeDeclarationBuilder():
case OmittedTypeDeclarationBuilder():
@@ -500,6 +502,7 @@
case ExtensionBuilder():
case InvalidTypeDeclarationBuilder():
case BuiltinTypeDeclarationBuilder():
+ // Coverage-ignore(suite): Not run.
// TODO(johnniwinther): How should we handle this case?
case OmittedTypeDeclarationBuilder():
case null:
diff --git a/pkg/front_end/lib/src/source/stack_listener_impl.dart b/pkg/front_end/lib/src/source/stack_listener_impl.dart
index 681b481..4efd455 100644
--- a/pkg/front_end/lib/src/source/stack_listener_impl.dart
+++ b/pkg/front_end/lib/src/source/stack_listener_impl.dart
@@ -40,10 +40,12 @@
/// Used to report an internal error encountered in the stack listener.
@override
+ // Coverage-ignore(suite): Not run.
Never internalProblem(Message message, int charOffset, Uri uri) {
return problems.internalProblem(message, charOffset, uri);
}
+ // Coverage-ignore(suite): Not run.
/// Used to report an unexpected situation encountered in the stack
/// listener.
Never unhandled(String what, String where, int charOffset, Uri? uri) {
diff --git a/pkg/front_end/lib/src/type_inference/closure_context.dart b/pkg/front_end/lib/src/type_inference/closure_context.dart
index 53bcae2..a4d1bfa 100644
--- a/pkg/front_end/lib/src/type_inference/closure_context.dart
+++ b/pkg/front_end/lib/src/type_inference/closure_context.dart
@@ -119,6 +119,7 @@
final InferenceVisitorBase inferrer;
@override
+ // Coverage-ignore(suite): Not run.
bool get isAsync => false;
/// The typing expectation for the subexpression of a `return` statement
@@ -129,6 +130,7 @@
DartType get returnContext => _returnContext;
@override
+ // Coverage-ignore(suite): Not run.
DartType get yieldContext => const UnknownType();
@override
@@ -200,6 +202,7 @@
..parent = statement;
} else if (!(returnType is VoidType || returnType is DynamicType) &&
expressionType is VoidType) {
+ // Coverage-ignore-block(suite): Not run.
// It is a compile-time error if s is `return e;`, T is neither void
// nor dynamic, and S is void.
statement.expression = inferrer.helper.wrapInProblem(
@@ -249,6 +252,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleYield(
YieldStatement node, ExpressionInferenceResult expressionResult) {
node.expression = expressionResult.expression..parent = node;
@@ -343,6 +347,7 @@
if (resultStatement is Block) {
resultStatement.statements.add(returnStatement);
} else {
+ // Coverage-ignore-block(suite): Not run.
resultStatement =
new Block(<Statement>[resultStatement, returnStatement])
..fileOffset = fileOffset;
@@ -359,6 +364,7 @@
final InferenceVisitorBase inferrer;
@override
+ // Coverage-ignore(suite): Not run.
bool get isAsync => true;
/// The typing expectation for the subexpression of a `return` statement
@@ -372,6 +378,7 @@
DartType get returnContext => _returnContext;
@override
+ // Coverage-ignore(suite): Not run.
DartType get yieldContext => const UnknownType();
@override
@@ -442,8 +449,11 @@
inferrer.typeSchemaEnvironment.flatten(expressionType);
if (emittedValueType is VoidType &&
!(flattenedExpressionType is VoidType ||
+ // Coverage-ignore(suite): Not run.
flattenedExpressionType is DynamicType ||
+ // Coverage-ignore(suite): Not run.
flattenedExpressionType is NullType)) {
+ // Coverage-ignore-block(suite): Not run.
// It is a compile-time error if s is `return e;`, T_v is void, and
// flatten(S) is neither void, dynamic, Null.
statement.expression = inferrer.helper.wrapInProblem(
@@ -456,6 +466,7 @@
} else if (!(emittedValueType is VoidType ||
emittedValueType is DynamicType) &&
flattenedExpressionType is VoidType) {
+ // Coverage-ignore-block(suite): Not run.
// It is a compile-time error if s is `return e;`, T_v is neither void
// nor dynamic, and flatten(S) is void.
statement.expression = inferrer.helper.wrapInProblem(
@@ -515,6 +526,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void handleYield(
YieldStatement node, ExpressionInferenceResult expressionResult) {
node.expression = expressionResult.expression..parent = node;
@@ -610,6 +622,7 @@
if (resultStatement is Block) {
resultStatement.statements.add(returnStatement);
} else {
+ // Coverage-ignore-block(suite): Not run.
resultStatement =
new Block(<Statement>[resultStatement, returnStatement])
..fileOffset = fileOffset;
@@ -641,6 +654,7 @@
final DartType _yieldElementContext;
@override
+ // Coverage-ignore(suite): Not run.
DartType get returnContext => const UnknownType();
@override
@@ -671,6 +685,7 @@
/// Updates the inferred return type based on the presence of a return
/// statement returning the given [type].
@override
+ // Coverage-ignore(suite): Not run.
void handleReturn(ReturnStatement statement, DartType type, bool isArrow) {}
@override
@@ -716,7 +731,9 @@
.getStandardUpperBound(inferredElementType, type);
}
}
- } else if (hasImplicitReturn) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (hasImplicitReturn) {
// No explicit returns we have an implicit `return null`.
inferredElementType = const NullType();
} else {
@@ -730,6 +747,7 @@
if (!inferrer.typeSchemaEnvironment.isSubtypeOf(inferredType,
_yieldElementContext, SubtypeCheckMode.withNullabilities)) {
+ // Coverage-ignore-block(suite): Not run.
// If the inferred return type isn't a subtype of the context, we use the
// context.
inferredType = inferrer.computeGreatestClosure2(_declaredReturnType);
@@ -774,6 +792,7 @@
final DartType _yieldElementContext;
@override
+ // Coverage-ignore(suite): Not run.
DartType get returnContext => const UnknownType();
@override
@@ -804,6 +823,7 @@
/// Updates the inferred return type based on the presence of a return
/// statement returning the given [type].
@override
+ // Coverage-ignore(suite): Not run.
void handleReturn(ReturnStatement statement, DartType type, bool isArrow) {}
@override
@@ -849,7 +869,9 @@
.getStandardUpperBound(inferredElementType, elementType);
}
}
- } else if (hasImplicitReturn) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (hasImplicitReturn) {
// No explicit returns we have an implicit `return null`.
inferredElementType = const NullType();
} else {
diff --git a/pkg/front_end/lib/src/type_inference/delayed_expressions.dart b/pkg/front_end/lib/src/type_inference/delayed_expressions.dart
index ab6f8de..e05e4dc 100644
--- a/pkg/front_end/lib/src/type_inference/delayed_expressions.dart
+++ b/pkg/front_end/lib/src/type_inference/delayed_expressions.dart
@@ -170,6 +170,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) =>
typeEnvironment.coreTypes.boolNonNullableRawType;
@@ -195,6 +196,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) =>
typeEnvironment.coreTypes.intNonNullableRawType;
@@ -202,6 +204,7 @@
void registerUse() {}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) => identical(this, expression);
}
@@ -225,6 +228,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) =>
typeEnvironment.coreTypes.boolNonNullableRawType;
@@ -238,6 +242,7 @@
bool uses(DelayedExpression expression) =>
identical(this, expression) ||
_left.uses(expression) ||
+ // Coverage-ignore(suite): Not run.
_right.uses(expression);
@override
@@ -376,6 +381,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) =>
typeEnvironment.coreTypes.boolNonNullableRawType;
@@ -386,6 +392,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) ||
_left.uses(expression) ||
@@ -414,6 +421,7 @@
{List<Expression>? effects, required bool inCacheInitializer}) {
DelayedExpression? lateEffect = _lateEffect;
if (lateEffect != null) {
+ // Coverage-ignore-block(suite): Not run.
if (effects != null) {
effects.add(lateEffect.createExpression(typeEnvironment,
effects: effects, inCacheInitializer: inCacheInitializer));
@@ -436,6 +444,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) {
return _result.getType(typeEnvironment);
}
@@ -444,14 +453,18 @@
void registerUse() {
_effect.registerUse();
_result.registerUse();
- _lateEffect?.registerUse();
+ _lateEffect
+ // Coverage-ignore(suite): Not run.
+ ?.registerUse();
}
@override
bool uses(DelayedExpression expression) =>
identical(this, expression) ||
_effect.uses(expression) ||
+ // Coverage-ignore(suite): Not run.
_result.uses(expression) ||
+ // Coverage-ignore(suite): Not run.
(_lateEffect != null && _lateEffect.uses(expression));
@override
@@ -464,6 +477,7 @@
_effect.createStatements(typeEnvironment, results, effects: effects);
_result.createStatements(typeEnvironment, results, effects: effects);
if (_lateEffect != null) {
+ // Coverage-ignore-block(suite): Not run.
if (effects != null) {
_lateEffect.createStatements(typeEnvironment, effects);
} else {
@@ -484,6 +498,7 @@
createStatements(typeEnvironment, results, effects: statementEffects);
return null;
} else {
+ // Coverage-ignore-block(suite): Not run.
return createExpression(typeEnvironment,
inCacheInitializer: false, effects: expressionEffects);
}
@@ -510,6 +525,7 @@
Expression createExpression(TypeEnvironment typeEnvironment,
{List<Expression>? effects, required bool inCacheInitializer}) {
if (effects != null && hasEffect) {
+ // Coverage-ignore-block(suite): Not run.
VariableDeclaration tempVariable =
_cache.createTemporaryVariable(_type, fileOffset: fileOffset);
effects.add(createVariableSet(_target, createVariableGet(tempVariable),
@@ -563,6 +579,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) {
return typeEnvironment.coreTypes.boolNonNullableRawType;
}
@@ -603,6 +620,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) {
return typeEnvironment.coreTypes.boolNonNullableRawType;
}
@@ -638,6 +656,7 @@
Expression operand = _operand.createExpression(typeEnvironment,
effects: effects, inCacheInitializer: inCacheInitializer);
if (isCovarianceCheck) {
+ // Coverage-ignore-block(suite): Not run.
return createAsExpression(operand, _type,
forNonNullableByDefault: true,
isCovarianceCheck: true,
@@ -666,6 +685,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _operand.uses(expression);
}
@@ -697,6 +717,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _operand.uses(expression);
}
@@ -718,6 +739,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) {
return typeEnvironment.coreTypes.boolNonNullableRawType;
}
@@ -728,6 +750,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _operand.uses(expression);
}
@@ -787,6 +810,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _receiver.uses(expression);
}
@@ -827,6 +851,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _receiver.uses(expression);
}
@@ -861,6 +886,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _receiver.uses(expression);
}
@@ -911,6 +937,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) {
if (identical(this, expression)) return true;
if (_receiver.uses(expression)) return true;
@@ -957,6 +984,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _receiver.uses(expression);
}
@@ -977,6 +1005,7 @@
.where((element) => element.name == _name)
.length ==
1,
+ // Coverage-ignore(suite): Not run.
"Invalid record type $_recordType for named access of '$_name'.");
@override
@@ -1003,6 +1032,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) || _receiver.uses(expression);
}
@@ -1053,6 +1083,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) {
if (identical(this, expression)) return true;
if (_receiver.uses(expression)) return true;
@@ -1108,6 +1139,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) {
if (identical(this, expression)) return true;
for (DelayedExpression argument in _arguments) {
@@ -1157,6 +1189,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) =>
identical(this, expression) ||
_left.uses(expression) ||
@@ -1177,6 +1210,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getType(TypeEnvironment typeEnvironment) {
return typeEnvironment.coreTypes.boolNonNullableRawType;
}
@@ -1187,6 +1221,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool uses(DelayedExpression expression) {
return identical(this, expression) || _expression.uses(expression);
}
diff --git a/pkg/front_end/lib/src/type_inference/external_ast_helper.dart b/pkg/front_end/lib/src/type_inference/external_ast_helper.dart
index 25bd7d8..91bfa91 100644
--- a/pkg/front_end/lib/src/type_inference/external_ast_helper.dart
+++ b/pkg/front_end/lib/src/type_inference/external_ast_helper.dart
@@ -137,7 +137,9 @@
arguments: createArguments([value], fileOffset: fileOffset),
fileOffset: fileOffset);
} else {
- assert(allowFinalAssignment || variable.isAssignable,
+ assert(
+ allowFinalAssignment || variable.isAssignable,
+ // Coverage-ignore(suite): Not run.
"Cannot assign to variable $variable");
return new VariableSet(variable, value)..fileOffset = fileOffset;
}
@@ -151,7 +153,8 @@
required int fileOffset}) {
return new LocalFunctionInvocation(
variable,
- arguments ?? createArguments([], fileOffset: fileOffset)
+ arguments ?? // Coverage-ignore(suite): Not run.
+ createArguments([], fileOffset: fileOffset)
..fileOffset = fileOffset,
functionType: variable.type as FunctionType)
..fileOffset = fileOffset;
diff --git a/pkg/front_end/lib/src/type_inference/factor_type.dart b/pkg/front_end/lib/src/type_inference/factor_type.dart
index ab6c5e8..d4c1c1e 100644
--- a/pkg/front_end/lib/src/type_inference/factor_type.dart
+++ b/pkg/front_end/lib/src/type_inference/factor_type.dart
@@ -33,6 +33,7 @@
// * Else if T is R* and Null <: S then factor(R, S)
// * Else if T is R* then factor(R, S)*
if (T.declaredNullability == Nullability.legacy) {
+ // Coverage-ignore-block(suite): Not run.
DartType R = T.withDeclaredNullability(Nullability.nonNullable);
DartType factor_RS = factorType(typeEnvironment, R, S);
if (typeEnvironment.isSubtypeOf(
@@ -53,6 +54,7 @@
return factorType(typeEnvironment, R, S);
}
if (typeEnvironment.isSubtypeOf(R, S, SubtypeCheckMode.withNullabilities)) {
+ // Coverage-ignore-block(suite): Not run.
return factorType(typeEnvironment, future_R, S);
}
}
diff --git a/pkg/front_end/lib/src/type_inference/for_in.dart b/pkg/front_end/lib/src/type_inference/for_in.dart
index 9afa05d..794d9ab 100644
--- a/pkg/front_end/lib/src/type_inference/for_in.dart
+++ b/pkg/front_end/lib/src/type_inference/for_in.dart
@@ -74,6 +74,7 @@
PatternVariableDeclarationForInVariable(this.patternVariableDeclaration);
@override
+ // Coverage-ignore(suite): Not run.
DartType computeElementType(InferenceVisitorBase visitor) {
return (patternVariableDeclaration.initializer as VariableGet)
.variable
@@ -117,6 +118,7 @@
if (writeTarget.isInstanceMember || writeTarget.isObjectMember) {
if (visitor.instrumentation != null &&
receiverType == const DynamicType()) {
+ // Coverage-ignore-block(suite): Not run.
visitor.instrumentation!.record(
visitor.uriForInstrumentation,
propertySet.fileOffset,
@@ -147,6 +149,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class AbstractSuperPropertyForInVariable implements ForInVariable {
final AbstractSuperPropertySet superPropertySet;
@@ -197,7 +200,9 @@
ObjectAccessTarget writeTarget = visitor.findInterfaceMember(
receiverType, superPropertySet.name, superPropertySet.fileOffset,
isSetter: true, instrumented: true);
- assert(writeTarget.isInstanceMember || writeTarget.isObjectMember);
+ assert(writeTarget.isInstanceMember ||
+ // Coverage-ignore(suite): Not run.
+ writeTarget.isObjectMember);
return _writeType = writeTarget.getSetterType(visitor);
}
diff --git a/pkg/front_end/lib/src/type_inference/inference_results.dart b/pkg/front_end/lib/src/type_inference/inference_results.dart
index b3c398c..e51ff0b 100644
--- a/pkg/front_end/lib/src/type_inference/inference_results.dart
+++ b/pkg/front_end/lib/src/type_inference/inference_results.dart
@@ -24,6 +24,7 @@
if (statements.length == 0) {
return const StatementInferenceResult();
} else if (statements.length == 1) {
+ // Coverage-ignore-block(suite): Not run.
return new SingleStatementInferenceResult(statements.single);
} else {
return new MultipleStatementInferenceResult(fileOffset, statements);
@@ -32,12 +33,15 @@
bool get hasChanged => false;
+ // Coverage-ignore(suite): Not run.
Statement get statement =>
throw new UnsupportedError('StatementInferenceResult.statement');
+ // Coverage-ignore(suite): Not run.
int get statementCount =>
throw new UnsupportedError('StatementInferenceResult.statementCount');
+ // Coverage-ignore(suite): Not run.
List<Statement> get statements =>
throw new UnsupportedError('StatementInferenceResult.statements');
}
@@ -55,6 +59,7 @@
int get statementCount => 1;
@override
+ // Coverage-ignore(suite): Not run.
List<Statement> get statements =>
throw new UnsupportedError('SingleStatementInferenceResult.statements');
}
@@ -76,6 +81,7 @@
bool get hasChanged => true;
@override
+ // Coverage-ignore(suite): Not run.
Statement get statement {
if (statements.length == 1) {
return statements.single;
@@ -147,9 +153,11 @@
return InvocationInferenceResult._insertHoistedExpressions(
expression, hoistedArguments);
} else if (expression is TypeAliasedConstructorInvocation) {
+ // Coverage-ignore-block(suite): Not run.
return InvocationInferenceResult._insertHoistedExpressions(
expression, hoistedArguments);
} else if (expression is TypeAliasedFactoryInvocation) {
+ // Coverage-ignore-block(suite): Not run.
return InvocationInferenceResult._insertHoistedExpressions(
expression, hoistedArguments);
} else if (expression is ConstructorInvocation) {
@@ -353,7 +361,9 @@
ExpressionInferenceResult(this.inferredType, this.expression,
{this.postCoercionType = null})
- : assert(isKnown(inferredType), "$inferredType is not known.");
+ : assert(
+ isKnown(inferredType), // Coverage-ignore(suite): Not run.
+ "$inferredType is not known.");
/// The guards used for null-aware access if the expression is part of a
/// null-shorting.
@@ -457,6 +467,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType? get postCoercionType => null;
@override
diff --git a/pkg/front_end/lib/src/type_inference/inference_visitor.dart b/pkg/front_end/lib/src/type_inference/inference_visitor.dart
index a055292..f261a21 100644
--- a/pkg/front_end/lib/src/type_inference/inference_visitor.dart
+++ b/pkg/front_end/lib/src/type_inference/inference_visitor.dart
@@ -191,6 +191,7 @@
/// Used to report an internal error encountered in the stack listener.
@override
+ // Coverage-ignore(suite): Not run.
Never internalProblem(Message message, int charOffset, Uri uri) {
return problems.internalProblem(message, charOffset, uri);
}
@@ -290,10 +291,12 @@
if (coreTypes.isBottom(result.inferredType)) {
flowAnalysis.handleExit();
if (shouldThrowUnsoundnessException &&
+ // Coverage-ignore(suite): Not run.
// Don't throw on expressions that inherently return the bottom type.
!(result.nullAwareAction is Throw ||
result.nullAwareAction is Rethrow ||
result.nullAwareAction is InvalidExpression)) {
+ // Coverage-ignore-block(suite): Not run.
Expression replacement = createLet(
createVariable(result.expression, result.inferredType),
createReachabilityError(
@@ -367,6 +370,7 @@
return nullAwareGuards;
}
+ // Coverage-ignore(suite): Not run.
/// Computes uri and offset for [node] for internal errors in a way that is
/// safe for both top-level and full inference.
UriOffset _computeUriOffset(TreeNode node) {
@@ -375,6 +379,7 @@
return new UriOffset(uri, fileOffset);
}
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult _unhandledExpression(
Expression node, DartType typeContext) {
UriOffset uriOffset = _computeUriOffset(node);
@@ -389,6 +394,7 @@
// therefore doesn't specify the type context for the subterms.
StatementInferenceResult bodyResult = inferStatement(node.body);
if (bodyResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.body = (bodyResult.statement as Block)..parent = node;
}
ExpressionInferenceResult valueResult =
@@ -398,6 +404,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitConstantExpression(
ConstantExpression node, DartType typeContext) {
return _unhandledExpression(node, typeContext);
@@ -414,6 +421,7 @@
resultType = const DynamicType();
break;
case DynamicAccessKind.Never:
+ // Coverage-ignore(suite): Not run.
resultType = NeverType.fromNullability(Nullability.nonNullable);
break;
case DynamicAccessKind.Invalid:
@@ -425,6 +433,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitInstanceGet(
InstanceGet node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -433,6 +442,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitInstanceTearOff(
InstanceTearOff node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -441,6 +451,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitDynamicInvocation(
DynamicInvocation node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -449,6 +460,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitDynamicSet(
DynamicSet node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -457,6 +469,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitEqualsCall(
EqualsCall node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -465,6 +478,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitEqualsNull(
EqualsNull node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -473,6 +487,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitFunctionInvocation(
FunctionInvocation node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -481,6 +496,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitInstanceInvocation(
InstanceInvocation node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -489,6 +505,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitInstanceGetterInvocation(
InstanceGetterInvocation node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -497,6 +514,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitInstanceSet(
InstanceSet node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -505,6 +523,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitLocalFunctionInvocation(
LocalFunctionInvocation node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -522,6 +541,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitFunctionTearOff(
FunctionTearOff node, DartType typeContext) {
// This node is created as part of a lowering and doesn't need inference.
@@ -539,6 +559,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitInstanceCreation(
InstanceCreation node, DartType typeContext) {
return _unhandledExpression(node, typeContext);
@@ -570,6 +591,7 @@
node.expression = expressionResult.expression..parent = node;
assert(
expressionResult.inferredType is FunctionType,
+ // Coverage-ignore(suite): Not run.
"Expected a FunctionType from tearing off a constructor from "
"a typedef, but got '${expressionResult.inferredType.runtimeType}'.");
FunctionType expressionType = expressionResult.inferredType as FunctionType;
@@ -592,23 +614,27 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitListConcatenation(
ListConcatenation node, DartType typeContext) {
return _unhandledExpression(node, typeContext);
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitMapConcatenation(
MapConcatenation node, DartType typeContext) {
return _unhandledExpression(node, typeContext);
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitSetConcatenation(
SetConcatenation node, DartType typeContext) {
return _unhandledExpression(node, typeContext);
}
+ // Coverage-ignore(suite): Not run.
StatementInferenceResult _unhandledStatement(Statement node) {
UriOffset uriOffset = _computeUriOffset(node);
return problems.unhandled("${node.runtimeType}", "InferenceVisitor",
@@ -616,31 +642,37 @@
}
@override
+ // Coverage-ignore(suite): Not run.
StatementInferenceResult visitAssertBlock(AssertBlock node) {
return _unhandledStatement(node);
}
@override
+ // Coverage-ignore(suite): Not run.
StatementInferenceResult visitTryCatch(TryCatch node) {
return _unhandledStatement(node);
}
@override
+ // Coverage-ignore(suite): Not run.
StatementInferenceResult visitTryFinally(TryFinally node) {
return _unhandledStatement(node);
}
+ // Coverage-ignore(suite): Not run.
Never _unhandledInitializer(Initializer node) {
problems.unhandled("${node.runtimeType}", "InferenceVisitor",
node.fileOffset, node.location!.file);
}
@override
+ // Coverage-ignore(suite): Not run.
InitializerInferenceResult visitInvalidInitializer(InvalidInitializer node) {
_unhandledInitializer(node);
}
@override
+ // Coverage-ignore(suite): Not run.
InitializerInferenceResult visitLocalInitializer(LocalInitializer node) {
_unhandledInitializer(node);
}
@@ -709,6 +741,7 @@
case ObjectAccessTargetKind.recordNamed:
case ObjectAccessTargetKind.nullableExtensionTypeMember:
case ObjectAccessTargetKind.extensionTypeRepresentation:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.nullableExtensionTypeRepresentation:
break;
}
@@ -785,6 +818,7 @@
InitializerInferenceResult visitAssertInitializer(AssertInitializer node) {
StatementInferenceResult result = inferStatement(node.statement);
if (result.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.statement = (result.statement as AssertStatement)..parent = node;
}
return const SuccessfulInitializerInferenceResult();
@@ -825,6 +859,7 @@
case TypeParameterType():
return _isIncompatibleWithAwait(type.parameter.bound);
case StructuralParameterType():
+ // Coverage-ignore(suite): Not run.
return _isIncompatibleWithAwait(type.parameter.bound);
case IntersectionType():
return _isIncompatibleWithAwait(type.right);
@@ -900,7 +935,9 @@
List<Statement>? result = _visitStatements<Statement>(node.statements);
if (result != null) {
Block block = new Block(result)..fileOffset = node.fileOffset;
- libraryBuilder.loader.dataForTesting?.registerAlias(node, block);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(node, block);
return new StatementInferenceResult.single(block);
} else {
return const StatementInferenceResult();
@@ -1198,6 +1235,7 @@
Expression readReceiver;
Expression writeReceiver;
if (isPureExpression(receiver)) {
+ // Coverage-ignore-block(suite): Not run.
readReceiver = receiver;
writeReceiver = clonePureExpression(receiver);
} else {
@@ -1215,6 +1253,7 @@
Expression read;
if (readTarget.isMissing) {
+ // Coverage-ignore-block(suite): Not run.
read = createMissingPropertyGet(
node.readOffset, readType, node.propertyName,
receiver: readReceiver);
@@ -1309,6 +1348,7 @@
flowAnalysis.doStatement_bodyBegin(node);
StatementInferenceResult bodyResult = inferStatement(node.body);
if (bodyResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.body = bodyResult.statement..parent = node;
}
flowAnalysis.doStatement_conditionBegin();
@@ -1425,7 +1465,9 @@
/// Returns the function type of [factory] when called through [typedef].
FunctionType _computeAliasedFactoryFunctionType(
Procedure factory, Typedef typedef) {
- assert(factory.isFactory || factory.isExtensionTypeMember,
+ assert(
+ factory.isFactory || factory.isExtensionTypeMember,
+ // Coverage-ignore(suite): Not run.
"Only run this method on a factory: $factory");
ensureMemberType(factory);
FunctionNode function = factory.function;
@@ -1451,9 +1493,11 @@
substitution.substituteType(decl.type))
.toList(growable: false);
List<NamedType> named = function.namedParameters
- .map((VariableDeclaration decl) => new NamedType(
- decl.name!, substitution.substituteType(decl.type),
- isRequired: decl.isRequired))
+ .map(
+ // Coverage-ignore(suite): Not run.
+ (VariableDeclaration decl) => new NamedType(
+ decl.name!, substitution.substituteType(decl.type),
+ isRequired: decl.isRequired))
.toList(growable: false);
named.sort();
return new FunctionType(
@@ -1543,6 +1587,7 @@
variable = tempVariable;
}
if (expressionEffects != null) {
+ // Coverage-ignore-block(suite): Not run.
StatementInferenceResult bodyResult = inferStatement(expressionEffects);
if (bodyResult.hasChanged) {
expressionEffects = bodyResult.statement;
@@ -1598,6 +1643,7 @@
} else if (syntheticAssignment is PropertySet) {
return new PropertyForInVariable(syntheticAssignment);
} else if (syntheticAssignment is AbstractSuperPropertySet) {
+ // Coverage-ignore-block(suite): Not run.
return new AbstractSuperPropertyForInVariable(syntheticAssignment);
} else if (syntheticAssignment is SuperPropertySet) {
return new SuperPropertyForInVariable(syntheticAssignment);
@@ -1606,6 +1652,7 @@
} else if (syntheticAssignment is InvalidExpression || hasProblem) {
return new InvalidForInVariable(syntheticAssignment);
} else {
+ // Coverage-ignore-block(suite): Not run.
UriOffset uriOffset = _computeUriOffset(syntheticAssignment!);
return problems.unhandled(
"${syntheticAssignment.runtimeType}",
@@ -1639,8 +1686,11 @@
}
if (expressionEffects != null) {
StatementInferenceResult result = inferStatement(expressionEffects);
- expressionEffects =
- result.hasChanged ? result.statement : expressionEffects;
+ expressionEffects = result.hasChanged
+ ?
+ // Coverage-ignore(suite): Not run.
+ result.statement
+ : expressionEffects;
}
return new ForInResult(variable, iterableResult.expression,
@@ -1677,6 +1727,7 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, patternVariableDeclaration.pattern)) {
+ // Coverage-ignore-block(suite): Not run.
patternVariableDeclaration.pattern = (rewrite as Pattern)
..parent = patternVariableDeclaration;
}
@@ -1707,6 +1758,7 @@
syntheticAssignment =
forInVariable.inferAssignment(this, result.elementType);
if (syntheticAssignment is VariableSet) {
+ // Coverage-ignore-block(suite): Not run.
flowAnalysis.write(node, variable, result.elementType, null);
}
@@ -1751,6 +1803,7 @@
body = combineStatements(result.expressionSideEffects!, body);
}
if (result.syntheticAssignment != null) {
+ // Coverage-ignore-block(suite): Not run.
body = combineStatements(
createExpressionStatement(result.syntheticAssignment!), body);
}
@@ -1773,7 +1826,11 @@
// [handleForInWithoutVariable] or [handleForInDeclaringVariable].
flowAnalysis.forEach_end();
- Statement body = bodyResult.hasChanged ? bodyResult.statement : node.body;
+ Statement body = bodyResult.hasChanged
+ ?
+ // Coverage-ignore(suite): Not run.
+ bodyResult.statement
+ : node.body;
if (result.expressionSideEffects != null) {
body = combineStatements(result.expressionSideEffects!, body);
}
@@ -1786,7 +1843,9 @@
isAsync: node.isAsync)
..fileOffset = node.fileOffset
..bodyOffset = node.bodyOffset;
- libraryBuilder.loader.dataForTesting?.registerAlias(node, replacement);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(node, replacement);
return new StatementInferenceResult.single(replacement);
}
@@ -1806,6 +1865,7 @@
} else {
StatementInferenceResult variableResult = inferStatement(variable);
if (variableResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
if (variables == null) {
variables = <VariableDeclaration>[];
variables.addAll(node.variables.sublist(0, index));
@@ -1817,12 +1877,15 @@
variables.add(variable as VariableDeclaration);
}
}
- } else if (variables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (variables != null) {
variables.add(variable);
}
}
}
if (variables != null) {
+ // Coverage-ignore-block(suite): Not run.
node.variables.clear();
node.variables.addAll(variables);
setParents(variables, node);
@@ -1841,6 +1904,7 @@
flowAnalysis.for_bodyBegin(node, node.condition);
StatementInferenceResult bodyResult = inferStatement(node.body);
if (bodyResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.body = bodyResult.statement..parent = node;
}
flowAnalysis.for_updaterBegin();
@@ -1872,7 +1936,10 @@
node.hasImplicitReturnType ? null : node.function.returnType;
FunctionType inferredType =
visitFunctionNode(node.function, null, returnContext, node.fileOffset);
- if (dataForTesting != null && node.hasImplicitReturnType) {
+ if (dataForTesting != null &&
+ // Coverage-ignore(suite): Not run.
+ node.hasImplicitReturnType) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredVariableTypes[node] =
inferredType.returnType;
}
@@ -1892,6 +1959,7 @@
FunctionType inferredType =
visitFunctionNode(node.function, typeContext, null, node.fileOffset);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredVariableTypes[node] =
inferredType.returnType;
}
@@ -2000,6 +2068,7 @@
StatementInferenceResult otherwiseResult =
inferStatement(node.otherwise!);
if (otherwiseResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.otherwise = otherwiseResult.statement..parent = node;
}
}
@@ -2032,10 +2101,12 @@
Object? rewrite = popRewrite(NullValues.Statement);
if (!identical(node.otherwise, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
node.otherwise = (rewrite as Statement)..parent = node;
}
rewrite = popRewrite();
if (!identical(node.then, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
node.then = (rewrite as Statement)..parent = node;
}
rewrite = popRewrite(NullValues.Expression);
@@ -2085,6 +2156,7 @@
Expression? error = checkWebIntLiteralsErrorIfUnexact(
node.value, node.literal, node.fileOffset);
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
return new ExpressionInferenceResult(const DynamicType(), error);
}
DartType inferredType = coreTypes.intRawType(Nullability.nonNullable);
@@ -2094,6 +2166,7 @@
ExpressionInferenceResult visitShadowLargeIntLiteral(
ShadowLargeIntLiteral node, DartType typeContext) {
if (isDoubleContext(typeContext)) {
+ // Coverage-ignore-block(suite): Not run.
double? doubleValue = node.asDouble();
if (doubleValue != null) {
Expression replacement = new DoubleLiteral(doubleValue)
@@ -2106,6 +2179,7 @@
int? intValue = node.asInt64();
if (intValue == null) {
+ // Coverage-ignore-block(suite): Not run.
Expression replacement = helper.buildProblem(
templateIntegerLiteralIsOutOfRange.withArguments(node.literal),
node.fileOffset,
@@ -2115,6 +2189,7 @@
Expression? error = checkWebIntLiteralsErrorIfUnexact(
intValue, node.literal, node.fileOffset);
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
return new ExpressionInferenceResult(const DynamicType(), error);
}
Expression replacement = new IntLiteral(intValue);
@@ -2159,6 +2234,7 @@
StatementInferenceResult bodyResult = inferStatement(node.body);
flowAnalysis.labeledStatement_end();
if (bodyResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.body = bodyResult.statement..parent = node;
}
return const StatementInferenceResult();
@@ -2223,6 +2299,7 @@
context: getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
element,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable));
}
@@ -2273,6 +2350,7 @@
context: getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
element,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable));
_copyNonPromotionReasonToReplacement(element, replacement);
}
@@ -2355,11 +2433,13 @@
Object? rewrite = popRewrite(NullValues.Expression);
if (!identical(element.otherwise, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
element.otherwise = (rewrite as Expression?)?..parent = element;
}
rewrite = popRewrite();
if (!identical(element.then, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
element.then = (rewrite as Expression)..parent = element;
}
@@ -2367,6 +2447,7 @@
rewrite = popRewrite(NullValues.Expression);
InvalidExpression? guardError = analysisResult.nonBooleanGuardError;
if (guardError != null) {
+ // Coverage-ignore-block(suite): Not run.
patternGuard.guard = guardError..parent = patternGuard;
} else {
if (!identical(patternGuard.guard, rewrite)) {
@@ -2381,11 +2462,13 @@
rewrite = popRewrite();
if (!identical(patternGuard.pattern, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
patternGuard.pattern = (rewrite as Pattern)..parent = patternGuard;
}
rewrite = popRewrite();
if (!identical(element.expression, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
element.expression = (rewrite as Expression)..parent = patternGuard;
}
@@ -2428,6 +2511,7 @@
Object? rewrite = popRewrite(NullValues.Expression);
if (!identical(patternVariableDeclaration.pattern, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
patternVariableDeclaration.pattern = (rewrite as Pattern)
..parent = patternVariableDeclaration;
}
@@ -2464,6 +2548,7 @@
} else {
StatementInferenceResult variableResult = inferStatement(variable);
if (variableResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
if (variables == null) {
variables = <VariableDeclaration>[];
variables.addAll(element.variables.sublist(0, index));
@@ -2475,12 +2560,15 @@
variables.add(variable as VariableDeclaration);
}
}
- } else if (variables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (variables != null) {
variables.add(variable);
}
}
}
if (variables != null) {
+ // Coverage-ignore-block(suite): Not run.
element.variables.clear();
element.variables.addAll(variables);
setParents(variables, element);
@@ -2539,6 +2627,7 @@
result.expressionSideEffects?.parent = element;
if (element.problem != null) {
+ // Coverage-ignore-block(suite): Not run.
ExpressionInferenceResult problemResult = inferExpression(
element.problem!, const UnknownType(),
isVoidAllowed: true);
@@ -2587,7 +2676,11 @@
void _copyNonPromotionReasonToReplacement(
TreeNode oldNode, TreeNode replacement) {
if (!identical(oldNode, replacement) &&
- dataForTesting?.flowAnalysisResult != null) {
+ dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.flowAnalysisResult !=
+ null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.flowAnalysisResult.nonPromotionReasons[replacement] =
dataForTesting!.flowAnalysisResult.nonPromotionReasons[oldNode]!;
}
@@ -2663,7 +2756,9 @@
listType, typeParametersToInfer, typeContext,
isConst: node.isConst,
typeOperations: operations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: node);
inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, typeParametersToInfer, null);
@@ -2686,6 +2781,7 @@
inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParametersToInfer, inferredTypes!);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredTypeArguments[node] =
inferredTypes;
}
@@ -2714,6 +2810,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitRecordLiteral(
RecordLiteral node, DartType typeContext) {
// TODO(cstefantsova): Implement this method.
@@ -2797,6 +2894,7 @@
// Create a list or set with the elements up to the first non-expression.
if (isSet) {
if (libraryBuilder.loader.target.backendTarget.supportsSetLiterals) {
+ // Coverage-ignore-block(suite): Not run.
// Include the elements up to the first non-expression in the set
// literal.
result = _createVariable(
@@ -2904,11 +3002,15 @@
if (elseStatements != null && elseStatements.isNotEmpty) {
elseBody = elseStatements.length == 1
? elseStatements.first
- : _createBlock(elseStatements);
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(elseStatements);
}
IfStatement ifStatement =
_createIf(element.fileOffset, element.condition, thenBody, elseBody);
- libraryBuilder.loader.dataForTesting?.registerAlias(element, ifStatement);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(element, ifStatement);
body.add(ifStatement);
}
@@ -2931,12 +3033,16 @@
}
Statement thenBody = thenStatements.length == 1
? thenStatements.first
- : _createBlock(thenStatements);
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(thenStatements);
Statement? elseBody;
if (elseStatements != null && elseStatements.isNotEmpty) {
elseBody = elseStatements.length == 1
? elseStatements.first
- : _createBlock(elseStatements);
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(elseStatements);
}
IfCaseStatement ifCaseStatement = _createIfCase(
element.fileOffset,
@@ -2946,6 +3052,7 @@
thenBody,
elseBody);
libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
?.registerAlias(element, ifCaseStatement);
body.addAll(element.prelude);
body.add(ifCaseStatement);
@@ -2962,7 +3069,9 @@
statements.length == 1 ? statements.first : _createBlock(statements);
ForStatement loop = _createForStatement(element.fileOffset,
element.variables, element.condition, element.updates, loopBody);
- libraryBuilder.loader.dataForTesting?.registerAlias(element, loop);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(element, loop);
body.add(loop);
}
@@ -2977,11 +3086,16 @@
_translateElement(
element.body, receiverType, elementType, result, statements,
isSet: isSet);
- Statement loopBody =
- statements.length == 1 ? statements.first : _createBlock(statements);
+ Statement loopBody = statements.length == 1
+ ? statements.first
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(statements);
ForStatement loop = _createForStatement(element.fileOffset,
element.variables, element.condition, element.updates, loopBody);
- libraryBuilder.loader.dataForTesting?.registerAlias(element, loop);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(element, loop);
body.add(element.patternVariableDeclaration);
body.addAll(element.intermediateVariables);
body.add(loop);
@@ -2995,8 +3109,11 @@
if (prologue == null) {
statements = <Statement>[];
} else {
- statements =
- prologue is Block ? prologue.statements : <Statement>[prologue];
+ statements = prologue is Block
+ ?
+ // Coverage-ignore(suite): Not run.
+ prologue.statements
+ : <Statement>[prologue];
}
_translateElement(
element.body, receiverType, elementType, result, statements,
@@ -3004,12 +3121,15 @@
Statement loopBody =
statements.length == 1 ? statements.first : _createBlock(statements);
if (element.problem != null) {
+ // Coverage-ignore-block(suite): Not run.
body.add(_createExpressionStatement(element.problem!));
}
ForInStatement loop = _createForInStatement(
element.fileOffset, element.variable, element.iterable, loopBody,
isAsync: element.isAsync);
- libraryBuilder.loader.dataForTesting?.registerAlias(element, loop);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(element, loop);
body.add(loop);
}
@@ -3250,12 +3370,17 @@
thenBody.length == 1 ? thenBody.first : _createBlock(thenBody);
Statement? elseStatement;
if (elseBody != null && elseBody.isNotEmpty) {
- elseStatement =
- elseBody.length == 1 ? elseBody.first : _createBlock(elseBody);
+ elseStatement = elseBody.length == 1
+ ? elseBody.first
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(elseBody);
}
IfStatement ifStatement = _createIf(
entry.fileOffset, entry.condition, thenStatement, elseStatement);
- libraryBuilder.loader.dataForTesting?.registerAlias(entry, ifStatement);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(entry, ifStatement);
body.add(ifStatement);
}
@@ -3274,12 +3399,18 @@
_translateEntry(entry.otherwise!, receiverType, keyType, valueType,
result, elseBody = <Statement>[]);
}
- Statement thenStatement =
- thenBody.length == 1 ? thenBody.first : _createBlock(thenBody);
+ Statement thenStatement = thenBody.length == 1
+ ? thenBody.first
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(thenBody);
Statement? elseStatement;
if (elseBody != null && elseBody.isNotEmpty) {
- elseStatement =
- elseBody.length == 1 ? elseBody.first : _createBlock(elseBody);
+ elseStatement = elseBody.length == 1
+ ? elseBody.first
+ :
+ // Coverage-ignore(suite): Not run.
+ _createBlock(elseBody);
}
IfCaseStatement ifStatement = _createIfCase(
entry.fileOffset,
@@ -3288,7 +3419,9 @@
entry.patternGuard,
thenStatement,
elseStatement);
- libraryBuilder.loader.dataForTesting?.registerAlias(entry, ifStatement);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(entry, ifStatement);
body.addAll(entry.prelude);
body.add(ifStatement);
}
@@ -3307,7 +3440,9 @@
statements.length == 1 ? statements.first : _createBlock(statements);
ForStatement loop = _createForStatement(entry.fileOffset, entry.variables,
entry.condition, entry.updates, loopBody);
- libraryBuilder.loader.dataForTesting?.registerAlias(entry, loop);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(entry, loop);
body.add(loop);
}
@@ -3325,7 +3460,9 @@
statements.length == 1 ? statements.first : _createBlock(statements);
ForStatement loop = _createForStatement(entry.fileOffset, entry.variables,
entry.condition, entry.updates, loopBody);
- libraryBuilder.loader.dataForTesting?.registerAlias(entry, loop);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(entry, loop);
body.add(entry.patternVariableDeclaration);
body.addAll(entry.intermediateVariables);
body.add(loop);
@@ -3343,20 +3480,26 @@
if (prologue == null) {
statements = <Statement>[];
} else {
- statements =
- prologue is Block ? prologue.statements : <Statement>[prologue];
+ statements = prologue is Block
+ ?
+ // Coverage-ignore(suite): Not run.
+ prologue.statements
+ : <Statement>[prologue];
}
_translateEntry(
entry.body, receiverType, keyType, valueType, result, statements);
Statement loopBody =
statements.length == 1 ? statements.first : _createBlock(statements);
if (entry.problem != null) {
+ // Coverage-ignore-block(suite): Not run.
body.add(_createExpressionStatement(entry.problem!));
}
ForInStatement loop = _createForInStatement(
entry.fileOffset, entry.variable, entry.iterable, loopBody,
isAsync: entry.isAsync);
- libraryBuilder.loader.dataForTesting?.registerAlias(entry, loop);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(entry, loop);
body.add(loop);
}
@@ -3520,6 +3663,7 @@
parts.add(spreadExpression);
}
} else if (element is IfElement) {
+ // Coverage-ignore-block(suite): Not run.
if (currentPart != null) {
parts.add(makeLiteral(node.fileOffset, currentPart));
currentPart = null;
@@ -3532,6 +3676,7 @@
parts.add(_createConditionalExpression(
element.fileOffset, condition, then, otherwise, iterableType));
} else if (element is ForElement || element is ForInElement) {
+ // Coverage-ignore-block(suite): Not run.
// Rejected earlier.
problems.unhandled("${element.runtimeType}", "_translateConstListOrSet",
element.fileOffset, helper.uri);
@@ -3594,6 +3739,7 @@
parts.add(spreadExpression);
}
} else if (entry is IfMapEntry) {
+ // Coverage-ignore-block(suite): Not run.
if (currentPart != null) {
parts.add(makeLiteral(node.fileOffset, currentPart));
currentPart = null;
@@ -3606,6 +3752,7 @@
parts.add(_createConditionalExpression(
entry.fileOffset, condition, then, otherwise, collectionType));
} else if (entry is ForMapEntry || entry is ForInMapEntry) {
+ // Coverage-ignore-block(suite): Not run.
// Rejected earlier.
problems.unhandled("${entry.runtimeType}", "_translateConstMap",
entry.fileOffset, helper.uri);
@@ -3646,6 +3793,7 @@
return new VariableGet(variable, promotedType)
..fileOffset = variable.fileOffset;
}
+ // Coverage-ignore(suite): Not run.
return _createVariableGet(variable);
}
@@ -3678,7 +3826,9 @@
Expression _createAdd(
Expression receiver, InterfaceType receiverType, Expression argument,
{required bool isSet}) {
- assert(argument.fileOffset != TreeNode.noOffset,
+ assert(
+ argument.fileOffset != TreeNode.noOffset,
+ // Coverage-ignore(suite): Not run.
"No fileOffset on ${argument}.");
DartType functionType = Substitution.fromInterfaceType(receiverType)
.substituteType(
@@ -3693,7 +3843,9 @@
Expression _createAddAll(Expression receiver, InterfaceType receiverType,
Expression argument, bool isSet) {
- assert(argument.fileOffset != TreeNode.noOffset,
+ assert(
+ argument.fileOffset != TreeNode.noOffset,
+ // Coverage-ignore(suite): Not run.
"No fileOffset on ${argument}.");
DartType functionType = Substitution.fromInterfaceType(receiverType)
.substituteType(isSet
@@ -3709,7 +3861,9 @@
Expression _createMapAddAll(
Expression receiver, InterfaceType receiverType, Expression argument) {
- assert(argument.fileOffset != TreeNode.noOffset,
+ assert(
+ argument.fileOffset != TreeNode.noOffset,
+ // Coverage-ignore(suite): Not run.
"No fileOffset on ${argument}.");
DartType functionType = Substitution.fromInterfaceType(receiverType)
.substituteType(engine.mapAddAllFunctionType);
@@ -3921,6 +4075,7 @@
context: getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
entry,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable));
_copyNonPromotionReasonToReplacement(entry, problem);
replacement = new SpreadMapEntry(problem, isNullAware: false)
@@ -3939,6 +4094,7 @@
context: getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
entry,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable));
_copyNonPromotionReasonToReplacement(entry, problem);
replacement = new MapLiteralEntry(problem, new NullLiteral())
@@ -4021,6 +4177,7 @@
context: getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
entry,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable));
_copyNonPromotionReasonToReplacement(entry, keyError);
}
@@ -4197,11 +4354,13 @@
Object? rewrite = popRewrite(NullValues.Expression);
if (!identical(entry.otherwise, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
entry.otherwise = (rewrite as MapLiteralEntry?)?..parent = entry;
}
rewrite = popRewrite();
if (!identical(entry.then, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
entry.then = (rewrite as MapLiteralEntry)..parent = entry;
}
@@ -4209,9 +4368,11 @@
rewrite = popRewrite(NullValues.Expression);
InvalidExpression? guardError = analysisResult.nonBooleanGuardError;
if (guardError != null) {
+ // Coverage-ignore-block(suite): Not run.
patternGuard.guard = guardError..parent = patternGuard;
} else {
if (!identical(patternGuard.guard, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
patternGuard.guard = (rewrite as Expression?)?..parent = patternGuard;
}
if (analysisResult.guardType is DynamicType) {
@@ -4223,11 +4384,13 @@
rewrite = popRewrite();
if (!identical(patternGuard.pattern, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
patternGuard.pattern = (rewrite as Pattern)..parent = patternGuard;
}
rewrite = popRewrite();
if (!identical(entry.expression, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
entry.expression = (rewrite as Expression)..parent = patternGuard;
}
@@ -4267,6 +4430,7 @@
Object? rewrite = popRewrite(NullValues.Expression);
if (!identical(patternVariableDeclaration.pattern, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
patternVariableDeclaration.pattern = (rewrite as Pattern)
..parent = patternVariableDeclaration;
}
@@ -4302,6 +4466,7 @@
} else {
StatementInferenceResult variableResult = inferStatement(variable);
if (variableResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
if (variables == null) {
variables = <VariableDeclaration>[];
variables.addAll(entry.variables.sublist(0, index));
@@ -4313,12 +4478,15 @@
variables.add(variable as VariableDeclaration);
}
}
- } else if (variables != null) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (variables != null) {
variables.add(variable);
}
}
}
if (variables != null) {
+ // Coverage-ignore-block(suite): Not run.
entry.variables.clear();
entry.variables.addAll(variables);
setParents(variables, entry);
@@ -4388,6 +4556,7 @@
entry.expressionEffects = result.expressionSideEffects;
result.expressionSideEffects?.parent = entry;
if (entry.problem != null) {
+ // Coverage-ignore-block(suite): Not run.
ExpressionInferenceResult problemResult = inferExpression(
entry.problem!, const UnknownType(),
isVoidAllowed: true);
@@ -4627,7 +4796,9 @@
mapType, typeParametersToInfer, typeContext,
isConst: node.isConst,
typeOperations: operations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: node);
inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, typeParametersToInfer, null);
@@ -4703,7 +4874,9 @@
setType, typeParametersToInfer, typeContext,
isConst: node.isConst,
typeOperations: operations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: node);
List<DartType> inferredTypesForSet = typeSchemaEnvironment
.choosePreliminaryTypes(gatherer, typeParametersToInfer, null);
@@ -4752,6 +4925,7 @@
inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParametersToInfer, inferredTypes!);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredTypeArguments[node] =
inferredTypes;
}
@@ -4845,6 +5019,7 @@
return new ExpressionInferenceResult(
result.inferredType, result.applyResult(invocation));
} else {
+ // Coverage-ignore-block(suite): Not run.
// TODO(johnniwinther): Handle augmentation of field with inferred types.
TypeInferenceEngine.resolveInferenceNode(member, hierarchyBuilder);
Link<NullAwareGuard> nullAwareGuards = const Link<NullAwareGuard>();
@@ -5390,7 +5565,9 @@
ExpressionInferenceResult visitSuperIndexSet(
SuperIndexSet node, DartType typeContext) {
ObjectAccessTarget indexSetTarget = thisType!.classNode.isMixinDeclaration
- ? new ObjectAccessTarget.interfaceMember(thisType!, node.setter,
+ ?
+ // Coverage-ignore(suite): Not run.
+ new ObjectAccessTarget.interfaceMember(thisType!, node.setter,
hasNonObjectMemberAccess: true)
: new ObjectAccessTarget.superMember(thisType!, node.setter);
@@ -5428,7 +5605,9 @@
// the type of the value parameter.
DartType inferredType = valueResult.inferredType;
- assert(indexSetTarget.isInstanceMember || indexSetTarget.isSuperMember,
+ assert(
+ indexSetTarget.isInstanceMember || indexSetTarget.isSuperMember,
+ // Coverage-ignore(suite): Not run.
'Unexpected index set target $indexSetTarget.');
instrumentation?.record(uriForInstrumentation, node.fileOffset, 'target',
new InstrumentationValueForMember(node.setter));
@@ -6021,7 +6200,9 @@
bool _isNull(Expression node) {
return node is NullLiteral ||
- node is ConstantExpression && node.constant is NullConstant;
+ node is ConstantExpression &&
+ // Coverage-ignore(suite): Not run.
+ node.constant is NullConstant;
}
/// Creates an equals expression of using [left] and [right] as operands.
@@ -6067,6 +6248,7 @@
equalsTarget.isInstanceMember ||
equalsTarget.isObjectMember ||
equalsTarget.isNever,
+ // Coverage-ignore(suite): Not run.
"Unexpected equals target $equalsTarget for "
"$left ($leftType) == $right.");
if (instrumentation != null && leftType == const DynamicType()) {
@@ -6218,10 +6400,12 @@
case ObjectAccessTargetKind.instanceMember:
case ObjectAccessTargetKind.objectMember:
case ObjectAccessTargetKind.nullableInstanceMember:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.superMember:
if ((binaryTarget.isInstanceMember || binaryTarget.isObjectMember) &&
instrumentation != null &&
leftType == const DynamicType()) {
+ // Coverage-ignore-block(suite): Not run.
instrumentation!.record(uriForInstrumentation, fileOffset, 'target',
new InstrumentationValueForMember(binaryTarget.member!));
}
@@ -6251,6 +6435,7 @@
..fileOffset = fileOffset;
}
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.recordIndexed:
case ObjectAccessTargetKind.recordNamed:
case ObjectAccessTargetKind.nullableRecordIndexed:
@@ -6264,6 +6449,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
whyNotPromoted?.call(),
binary,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
return new ExpressionInferenceResult(
binaryType,
@@ -6343,10 +6529,12 @@
case ObjectAccessTargetKind.instanceMember:
case ObjectAccessTargetKind.objectMember:
case ObjectAccessTargetKind.nullableInstanceMember:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.superMember:
if ((unaryTarget.isInstanceMember || unaryTarget.isObjectMember) &&
instrumentation != null &&
expressionType == const DynamicType()) {
+ // Coverage-ignore-block(suite): Not run.
instrumentation!.record(uriForInstrumentation, fileOffset, 'target',
new InstrumentationValueForMember(unaryTarget.member!));
}
@@ -6359,6 +6547,7 @@
..fileOffset = fileOffset;
if (unaryCheckKind == MethodContravarianceCheckKind.checkMethodReturn) {
+ // Coverage-ignore-block(suite): Not run.
if (instrumentation != null) {
instrumentation!.record(uriForInstrumentation, fileOffset,
'checkReturn', new InstrumentationValueForType(expressionType));
@@ -6369,6 +6558,7 @@
..fileOffset = fileOffset;
}
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.recordIndexed:
case ObjectAccessTargetKind.recordNamed:
case ObjectAccessTargetKind.nullableRecordIndexed:
@@ -6380,7 +6570,9 @@
if (unaryTarget.isNullable) {
List<LocatedMessage>? context = getWhyNotPromotedContext(
- whyNotPromoted(), unary, (type) => !type.isPotentiallyNullable);
+ whyNotPromoted(),
+ unary, // Coverage-ignore(suite): Not run.
+ (type) => !type.isPotentiallyNullable);
// TODO(johnniwinther): Special case 'unary-' in messages. It should
// probably be referred to as "Unary operator '-' ...".
return new ExpressionInferenceResult(
@@ -6390,7 +6582,11 @@
templateNullableOperatorCallError.withArguments(
unaryName.text, expressionType),
unary.fileOffset,
- unaryName == unaryMinusName ? 1 : unaryName.text.length,
+ unaryName == unaryMinusName
+ ? 1
+ :
+ // Coverage-ignore(suite): Not run.
+ unaryName.text.length,
context: context));
}
return new ExpressionInferenceResult(unaryType, unary);
@@ -6473,6 +6669,7 @@
case ObjectAccessTargetKind.instanceMember:
case ObjectAccessTargetKind.objectMember:
case ObjectAccessTargetKind.nullableInstanceMember:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.superMember:
InstanceAccessKind kind;
switch (readTarget.kind) {
@@ -6482,9 +6679,11 @@
case ObjectAccessTargetKind.nullableInstanceMember:
kind = InstanceAccessKind.Nullable;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $readTarget');
}
@@ -6511,6 +6710,7 @@
..fileOffset = fileOffset;
}
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.recordIndexed:
case ObjectAccessTargetKind.recordNamed:
case ObjectAccessTargetKind.nullableRecordIndexed:
@@ -6601,6 +6801,7 @@
case ObjectAccessTargetKind.instanceMember:
case ObjectAccessTargetKind.objectMember:
case ObjectAccessTargetKind.nullableInstanceMember:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.superMember:
InstanceAccessKind kind;
switch (writeTarget.kind) {
@@ -6610,9 +6811,11 @@
case ObjectAccessTargetKind.nullableInstanceMember:
kind = InstanceAccessKind.Nullable;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $writeTarget');
}
@@ -6623,6 +6826,7 @@
interfaceTarget: writeTarget.classMember as Procedure)
..fileOffset = fileOffset;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.recordIndexed:
case ObjectAccessTargetKind.recordNamed:
case ObjectAccessTargetKind.nullableRecordIndexed:
@@ -6776,6 +6980,7 @@
case ObjectAccessTargetKind.instanceMember:
case ObjectAccessTargetKind.objectMember:
case ObjectAccessTargetKind.nullableInstanceMember:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.superMember:
InstanceAccessKind kind;
switch (writeTarget.kind) {
@@ -6785,9 +6990,11 @@
case ObjectAccessTargetKind.nullableInstanceMember:
kind = InstanceAccessKind.Nullable;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $writeTarget');
}
@@ -6795,6 +7002,7 @@
interfaceTarget: writeTarget.classMember!)
..fileOffset = fileOffset;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.recordIndexed:
case ObjectAccessTargetKind.recordNamed:
case ObjectAccessTargetKind.extensionTypeRepresentation:
@@ -7483,6 +7691,7 @@
isSetter: true, instrumented: true, includeExtensionMethods: true);
if (target.isInstanceMember || target.isObjectMember) {
if (instrumentation != null && receiverType == const DynamicType()) {
+ // Coverage-ignore-block(suite): Not run.
instrumentation!.record(uriForInstrumentation, node.fileOffset,
'target', new InstrumentationValueForMember(target.member!));
}
@@ -7515,8 +7724,11 @@
ObjectAccessTarget target = new ObjectAccessTarget.interfaceMember(
thisType!, member,
hasNonObjectMemberAccess: true);
- if (target.isInstanceMember || target.isObjectMember) {
+ if (target.isInstanceMember ||
+ // Coverage-ignore(suite): Not run.
+ target.isObjectMember) {
if (instrumentation != null && receiverType == const DynamicType()) {
+ // Coverage-ignore-block(suite): Not run.
instrumentation!.record(uriForInstrumentation, node.fileOffset,
'target', new InstrumentationValueForMember(target.member!));
}
@@ -7684,6 +7896,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitRecordIndexGet(
RecordIndexGet node, DartType typeContext) {
ExpressionInferenceResult result =
@@ -7720,6 +7933,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitRecordNameGet(
RecordNameGet node, DartType typeContext) {
ExpressionInferenceResult result =
@@ -7926,7 +8140,9 @@
setType, typeParametersToInfer, typeContext,
isConst: node.isConst,
typeOperations: operations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: node);
inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, typeParametersToInfer, null);
@@ -7950,6 +8166,7 @@
inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParametersToInfer, inferredTypes!);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredTypeArguments[node] =
inferredTypes;
}
@@ -8045,6 +8262,7 @@
DartType type = target.getterType;
if (target is Procedure && target.kind == ProcedureKind.Method) {
+ // Coverage-ignore-block(suite): Not run.
Expression tearOff = new StaticTearOff(node.target as Procedure)
..fileOffset = node.fileOffset;
return instantiateTearOff(type, typeContext, tearOff);
@@ -8117,6 +8335,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitAbstractSuperMethodInvocation(
AbstractSuperMethodInvocation node, DartType typeContext) {
instrumentation?.record(uriForInstrumentation, node.fileOffset, 'target',
@@ -8135,6 +8354,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitAbstractSuperPropertyGet(
AbstractSuperPropertyGet node, DartType typeContext) {
instrumentation?.record(uriForInstrumentation, node.fileOffset, 'target',
@@ -8153,6 +8373,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitAbstractSuperPropertySet(
AbstractSuperPropertySet node, DartType typeContext) {
ObjectAccessTarget writeTarget = new ObjectAccessTarget.interfaceMember(
@@ -8287,6 +8508,7 @@
Object? rewrite = popRewrite();
if (!identical(expression, rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
expression = rewrite as Expression;
node.expression = expression..parent = node;
}
@@ -8295,6 +8517,7 @@
if (analysisResult.isExhaustive &&
!analysisResult.hasDefault &&
shouldThrowUnsoundnessException) {
+ // Coverage-ignore-block(suite): Not run.
if (!analysisResult.lastCaseTerminates) {
LabeledStatement breakTarget;
if (node.parent is LabeledStatement) {
@@ -8324,6 +8547,7 @@
assert(checkStack(node, stackBase, [/*empty*/]));
+ // Coverage-ignore(suite): Not run.
return replacement != null
? new StatementInferenceResult.single(replacement)
: const StatementInferenceResult();
@@ -8351,6 +8575,7 @@
for (int i = node.cases.length - 1; i >= 0; i--) {
Object? rewrite = popRewrite();
if (!identical(rewrite, node.cases[i])) {
+ // Coverage-ignore-block(suite): Not run.
node.cases[i] = (rewrite as PatternSwitchCase)..parent = node;
}
}
@@ -8422,6 +8647,7 @@
templateJointPatternVariablesMismatch
.withArguments(jointVariable.name!),
switchCase.jointVariableFirstUseOffsets?[i] ??
+ // Coverage-ignore(suite): Not run.
jointVariable.fileOffset,
noLength)
..parent = jointVariable;
@@ -8479,6 +8705,7 @@
void visitCatch(Catch node) {
StatementInferenceResult bodyResult = inferStatement(node.body);
if (bodyResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.body = bodyResult.statement..parent = node;
}
}
@@ -8527,11 +8754,15 @@
result = new TryFinally(
result,
finalizerResult!.hasChanged
- ? finalizerResult.statement
+ ?
+ // Coverage-ignore(suite): Not run.
+ finalizerResult.statement
: node.finallyBlock!)
..fileOffset = node.fileOffset;
}
- libraryBuilder.loader.dataForTesting?.registerAlias(node, result);
+ libraryBuilder.loader.dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.registerAlias(node, result);
_inTryOrLocalFunction = oldInTryOrLocalFunction;
return new StatementInferenceResult.single(result);
}
@@ -8633,6 +8864,7 @@
instrumentation?.record(uriForInstrumentation, node.fileOffset, 'type',
new InstrumentationValueForType(inferredType));
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredVariableTypes[node] =
inferredType;
}
@@ -8831,6 +9063,7 @@
ExpressionInferenceResult visitVariableGet(
VariableGet node, DartType typeContext) {
if (node is! VariableGetImpl) {
+ // Coverage-ignore-block(suite): Not run.
// This node is created as part of a lowering and doesn't need inference.
return new ExpressionInferenceResult(
node.promotedType ?? node.variable.type, node);
@@ -8873,11 +9106,19 @@
bool isUnassigned = !flowAnalysis.isAssigned(variable);
if (isUnassigned) {
- dataForTesting?.flowAnalysisResult.potentiallyUnassignedNodes.add(node);
+ dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.flowAnalysisResult // Coverage-ignore(suite): Not run.
+ .potentiallyUnassignedNodes // Coverage-ignore(suite): Not run.
+ .add(node);
}
bool isDefinitelyUnassigned = flowAnalysis.isUnassigned(variable);
if (isDefinitelyUnassigned) {
- dataForTesting?.flowAnalysisResult.definitelyUnassignedNodes.add(node);
+ dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.flowAnalysisResult // Coverage-ignore(suite): Not run.
+ .definitelyUnassignedNodes // Coverage-ignore(suite): Not run.
+ .add(node);
}
// Synthetic variables, local functions, and variables with
// invalid types aren't checked.
@@ -8898,6 +9139,7 @@
} else {
if (isUnassigned) {
if (variable.isFinal) {
+ // Coverage-ignore-block(suite): Not run.
return new ExpressionInferenceResult(
resultType,
helper.wrapInProblem(
@@ -8935,6 +9177,7 @@
flowAnalysis.whileStatement_bodyBegin(node, node.condition);
StatementInferenceResult bodyResult = inferStatement(node.body);
if (bodyResult.hasChanged) {
+ // Coverage-ignore-block(suite): Not run.
node.body = bodyResult.statement..parent = node;
}
flowAnalysis.whileStatement_end();
@@ -8986,6 +9229,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitCheckLibraryIsLoaded(
CheckLibraryIsLoaded node, DartType typeContext) {
// TODO(cstefantsova): Figure out the suitable nullability for that.
@@ -9046,6 +9290,7 @@
Expression? error = checkWebIntLiteralsErrorIfUnexact(
receiver.value, receiver.literal, receiver.fileOffset);
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
return new ExpressionInferenceResult(const DynamicType(), error);
}
} else if (node.expression is ShadowLargeIntLiteral) {
@@ -9053,6 +9298,7 @@
node.expression as ShadowLargeIntLiteral;
if (!receiver.isParenthesized) {
if (isDoubleContext(typeContext)) {
+ // Coverage-ignore-block(suite): Not run.
double? doubleValue = receiver.asDouble(negated: true);
if (doubleValue != null) {
Expression replacement = new DoubleLiteral(doubleValue)
@@ -9064,6 +9310,7 @@
}
int? intValue = receiver.asInt64(negated: true);
if (intValue == null) {
+ // Coverage-ignore-block(suite): Not run.
Expression error = helper.buildProblem(
templateIntegerLiteralIsOutOfRange
.withArguments(receiver.literal),
@@ -9074,6 +9321,7 @@
Expression? error = checkWebIntLiteralsErrorIfUnexact(
intValue, receiver.literal, receiver.fileOffset);
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
return new ExpressionInferenceResult(const DynamicType(), error);
}
expressionResult = new ExpressionInferenceResult(
@@ -9312,12 +9560,15 @@
Object? popRewrite([NullValue? nullValue]) {
Object entry = _rewriteStack.removeLast();
if (_debugRewriteStack) {
+ // Coverage-ignore-block(suite): Not run.
assert(_debugPrint('POP ${entry.runtimeType} $entry'));
}
if (entry is! NullValue) {
return entry;
}
- assert(nullValue == entry,
+ assert(
+ nullValue == entry,
+ // Coverage-ignore(suite): Not run.
"Unexpected null value. Expected ${nullValue}, actual $entry");
return null;
}
@@ -9325,11 +9576,13 @@
/// Pushes an entry onto [_rewriteStack].
void pushRewrite(Object node) {
if (_debugRewriteStack) {
+ // Coverage-ignore-block(suite): Not run.
assert(_debugPrint('PUSH ${node.runtimeType} $node'));
}
_rewriteStack.add(node);
}
+ // Coverage-ignore(suite): Not run.
/// Helper function used to print information to the console in debug mode.
/// This method returns `true` so that it can be conveniently called inside of
/// an `assert` statement.
@@ -9418,11 +9671,16 @@
elementType: node.typeArgument, elements: node.patterns);
} else if (node is MapPattern) {
return analyzeMapPatternSchema(
- typeArguments: node.keyType != null && node.valueType != null
- ? (keyType: node.keyType!, valueType: node.valueType!)
+ typeArguments: node.keyType != null &&
+ // Coverage-ignore(suite): Not run.
+ node.valueType != null
+ ?
+ // Coverage-ignore(suite): Not run.
+ (keyType: node.keyType!, valueType: node.valueType!)
: null,
elements: node.entries);
} else if (node is NamedPattern) {
+ // Coverage-ignore-block(suite): Not run.
return dispatchPatternSchema(node.pattern);
} else if (node is NullAssertPattern) {
return analyzeNullCheckOrAssertPatternSchema(node.pattern,
@@ -9433,6 +9691,7 @@
} else if (node is ObjectPattern) {
return analyzeObjectPatternSchema(node.requiredType);
} else if (node is OrPattern) {
+ // Coverage-ignore-block(suite): Not run.
return analyzeLogicalOrPatternSchema(node.left, node.right);
} else if (node is RecordPattern) {
return analyzeRecordPatternSchema(
@@ -9446,6 +9705,7 @@
node: element, name: null, pattern: element)
]);
} else if (node is RelationalPattern) {
+ // Coverage-ignore-block(suite): Not run.
return analyzeRelationalPatternSchema();
} else if (node is RestPattern) {
// This pattern can't appear on it's own.
@@ -9457,6 +9717,7 @@
} else if (node is InvalidPattern) {
return const InvalidType();
} else {
+ // Coverage-ignore-block(suite): Not run.
return problems.unhandled("${node.runtimeType}", "dispatchPatternSchema",
node is TreeNode ? node.fileOffset : TreeNode.noOffset, helper.uri);
}
@@ -9518,6 +9779,7 @@
body.statements.add(syntheticBreak);
syntheticBreak.parent = body;
} else {
+ // Coverage-ignore-block(suite): Not run.
body = new Block([body, syntheticBreak])..fileOffset = body.fileOffset;
case_.body = body..parent = case_;
}
@@ -9534,6 +9796,7 @@
popRewrite(); // CaseHead
}
} else {
+ // Coverage-ignore-block(suite): Not run.
popRewrite(); // CaseHead
}
} else {
@@ -9547,6 +9810,7 @@
popRewrite(); // CaseHead
}
} else {
+ // Coverage-ignore-block(suite): Not run.
popRewrite(); // CaseHead
}
}
@@ -9836,6 +10100,7 @@
InvalidExpression? error =
analysisResult.patternTypeMismatchInIrrefutableContextError;
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
replacement =
new InvalidPattern(error, declaredVariables: node.declaredVariables)
..fileOffset = error.fileOffset;
@@ -9871,6 +10136,7 @@
InvalidExpression? error =
analysisResult.patternTypeMismatchInIrrefutableContextError;
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
replacement =
new InvalidPattern(error, declaredVariables: node.declaredVariables)
..fileOffset = error.fileOffset;
@@ -9949,11 +10215,13 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, node.right)) {
+ // Coverage-ignore-block(suite): Not run.
node.right = (rewrite as Pattern)..parent = node;
}
rewrite = popRewrite();
if (!identical(rewrite, node.left)) {
+ // Coverage-ignore-block(suite): Not run.
node.left = (rewrite as Pattern)..parent = node;
}
@@ -9984,6 +10252,7 @@
InvalidExpression? error =
analysisResult.refutablePatternInIrrefutableContextError;
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
replacement =
new InvalidPattern(error, declaredVariables: node.declaredVariables)
..fileOffset = error.fileOffset;
@@ -9991,11 +10260,13 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, node.right)) {
+ // Coverage-ignore-block(suite): Not run.
node.right = (rewrite as Pattern)..parent = node;
}
rewrite = popRewrite();
if (!identical(rewrite, node.left)) {
+ // Coverage-ignore-block(suite): Not run.
node.left = (rewrite as Pattern)..parent = node;
}
@@ -10055,6 +10326,7 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, node.pattern)) {
+ // Coverage-ignore-block(suite): Not run.
node.pattern = (rewrite as Pattern)..parent = node;
}
@@ -10085,6 +10357,7 @@
InvalidExpression? error =
analysisResult.refutablePatternInIrrefutableContextError;
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
replacement =
new InvalidPattern(error, declaredVariables: node.declaredVariables)
..fileOffset = error.fileOffset;
@@ -10092,6 +10365,7 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, node.pattern)) {
+ // Coverage-ignore-block(suite): Not run.
node.pattern = (rewrite as Pattern)..parent = node;
}
@@ -10119,6 +10393,7 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, node.pattern)) {
+ // Coverage-ignore-block(suite): Not run.
node.pattern = (rewrite as Pattern)..parent = node;
}
@@ -10243,6 +10518,7 @@
lengthType, lessThanOrEqualsName, node.fileOffset,
includeExtensionMethods: true, isSetter: false);
assert(lessThanOrEqualsInvokeTarget.isInstanceMember ||
+ // Coverage-ignore(suite): Not run.
lessThanOrEqualsInvokeTarget.isObjectMember);
node.lengthCheckTarget =
@@ -10253,6 +10529,7 @@
lengthType, equalsName, node.fileOffset,
includeExtensionMethods: true, isSetter: false);
assert(equalsInvokeTarget.isInstanceMember ||
+ // Coverage-ignore(suite): Not run.
equalsInvokeTarget.isObjectMember);
node.lengthCheckTarget = equalsInvokeTarget.classMember as Procedure;
@@ -10310,6 +10587,7 @@
InvalidExpression? error =
analysisResult.patternTypeMismatchInIrrefutableContextError;
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
replacement =
new InvalidPattern(error, declaredVariables: node.declaredVariables)
..fileOffset = error.fileOffset;
@@ -10395,6 +10673,7 @@
field.accessKind = ObjectAccessKind.Direct;
field.resultType = fieldTarget.getGetterType(this);
case ObjectAccessTargetKind.superMember:
+ // Coverage-ignore(suite): Not run.
problems.unsupported(
'Object field target $fieldTarget', node.fileOffset, helper.uri);
case ObjectAccessTargetKind.extensionMember:
@@ -10414,6 +10693,7 @@
case ObjectAccessTargetKind.dynamic:
field.accessKind = ObjectAccessKind.Dynamic;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.never:
field.accessKind = ObjectAccessKind.Dynamic;
break;
@@ -10567,6 +10847,7 @@
case ObjectAccessTargetKind.nullableRecordNamed:
case ObjectAccessTargetKind.extensionTypeRepresentation:
case ObjectAccessTargetKind.nullableExtensionTypeRepresentation:
+ // Coverage-ignore(suite): Not run.
problems.unsupported('Relational pattern target $invokeTarget',
node.fileOffset, helper.uri);
case ObjectAccessTargetKind.extensionMember:
@@ -10622,6 +10903,7 @@
InvalidExpression? error =
analysisResult.patternTypeMismatchInIrrefutableContextError;
if (error != null) {
+ // Coverage-ignore-block(suite): Not run.
replacement =
new InvalidPattern(error, declaredVariables: node.declaredVariables)
..fileOffset = error.fileOffset;
@@ -10673,6 +10955,7 @@
for (int i = node.entries.length - 1; i >= 0; i--) {
Object? rewrite = popRewrite();
if (!identical(node.entries[i], rewrite)) {
+ // Coverage-ignore-block(suite): Not run.
node.entries[i] = (rewrite as MapPatternEntry)..parent = node;
}
}
@@ -10762,6 +11045,7 @@
if (resolvedType is RecordType) {
node.lookupType = resolvedType;
} else {
+ // Coverage-ignore-block(suite): Not run.
// In case of the matched type being an invalid type we use the
// required type instead.
node.lookupType = requiredType;
@@ -10773,6 +11057,7 @@
Object? rewrite = popRewrite();
if (subPattern is NamedPattern) {
if (!identical(rewrite, subPattern.pattern)) {
+ // Coverage-ignore-block(suite): Not run.
subPattern.pattern = (rewrite as Pattern)..parent = subPattern;
}
} else {
@@ -10912,7 +11197,9 @@
typeSchemaEnvironment.setupGenericTypeInference(
declaredType, typeParametersToInfer, contextType,
typeOperations: operations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: treeNodeForTesting);
return typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParametersToInfer, null);
@@ -11027,6 +11314,7 @@
context.offsets);
pushRewrite(element);
} else {
+ // Coverage-ignore-block(suite): Not run.
problems.unsupported(
"${element.runtimeType}", element.fileOffset, helper.uri);
}
@@ -11091,6 +11379,7 @@
Object? rewrite = popRewrite();
if (!identical(rewrite, restPattern.subPattern)) {
+ // Coverage-ignore-block(suite): Not run.
restPattern.subPattern = (rewrite as Pattern)..parent = restPattern;
}
} else {
@@ -11127,11 +11416,13 @@
covariant MapPatternEntry entryElement, DartType keyType) {
Object? rewrite = popRewrite();
if (!identical(rewrite, entryElement.value)) {
+ // Coverage-ignore-block(suite): Not run.
entryElement.value = rewrite as Pattern..parent = entryElement;
}
rewrite = popRewrite();
if (!identical(rewrite, entryElement.key)) {
+ // Coverage-ignore-block(suite): Not run.
entryElement.key = (rewrite as Expression)..parent = entryElement;
}
@@ -11183,6 +11474,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
ExpressionInferenceResult visitAuxiliaryExpression(
AuxiliaryExpression node, DartType typeContext) {
return _unhandledExpression(node, typeContext);
@@ -11194,10 +11486,12 @@
if (node is InternalInitializer) {
return node.acceptInference(this);
}
+ // Coverage-ignore(suite): Not run.
return _unhandledInitializer(node);
}
@override
+ // Coverage-ignore(suite): Not run.
StatementInferenceResult visitAuxiliaryStatement(AuxiliaryStatement node) {
return _unhandledStatement(node);
}
diff --git a/pkg/front_end/lib/src/type_inference/inference_visitor_base.dart b/pkg/front_end/lib/src/type_inference/inference_visitor_base.dart
index 109a355..08c99f6 100644
--- a/pkg/front_end/lib/src/type_inference/inference_visitor_base.dart
+++ b/pkg/front_end/lib/src/type_inference/inference_visitor_base.dart
@@ -184,6 +184,7 @@
DartType get bottomType => const NeverType.nonNullable();
+ // Coverage-ignore(suite): Not run.
StaticTypeContext get staticTypeContext => _inferrer.staticTypeContext;
DartType computeGreatestClosure(DartType type) {
@@ -201,6 +202,7 @@
return cfeOperations.getNullableType(type);
}
+ // Coverage-ignore(suite): Not run.
Expression createReachabilityError(int fileOffset, Message errorMessage) {
Arguments arguments = new Arguments([
new StringLiteral(errorMessage.problemMessage)..fileOffset = fileOffset
@@ -223,6 +225,7 @@
bool Function(DartType) typeFilter) {
List<LocatedMessage>? context;
if (whyNotPromoted != null && whyNotPromoted.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
_WhyNotPromotedVisitor whyNotPromotedVisitor =
new _WhyNotPromotedVisitor(this);
for (MapEntry<DartType, NonPromotionReason> entry
@@ -280,6 +283,7 @@
void registerIfUnreachableForTesting(TreeNode node, {bool? isReachable}) {
if (dataForTesting == null) return;
+ // Coverage-ignore-block(suite): Not run.
isReachable ??= flowAnalysis.isReachable;
if (!isReachable) {
dataForTesting!.flowAnalysisResult.unreachableNodes.add(node);
@@ -569,6 +573,7 @@
expression, messageVoidExpression, expression.fileOffset, noLength);
break;
case AssignabilityKind.unassignablePrecise:
+ // Coverage-ignore(suite): Not run.
// The type of the expression is known precisely, so an implicit
// downcast is guaranteed to fail. Insert a compile-time error.
result = helper.wrapInProblem(
@@ -611,6 +616,7 @@
context: getWhyNotPromotedContext(
whyNotPromoted.call(),
expression,
+ // Coverage-ignore(suite): Not run.
(type) => typeSchemaEnvironment.isSubtypeOf(type,
contextType, SubtypeCheckMode.withNullabilities)));
}
@@ -768,6 +774,7 @@
new Arguments([expression], types: target.receiverTypeArguments)
..fileOffset = fileOffset)
..fileOffset = fileOffset;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.extensionTypeRepresentation:
case ObjectAccessTargetKind.nullableInstanceMember:
case ObjectAccessTargetKind.objectMember:
@@ -837,6 +844,7 @@
case ObjectAccessTargetKind.callFunction:
case ObjectAccessTargetKind.nullableCallFunction:
case ObjectAccessTargetKind.extensionTypeRepresentation:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.nullableExtensionTypeRepresentation:
shouldTearOff = false;
}
@@ -893,6 +901,7 @@
}
}
if (isExpressionTypePrecise) {
+ // Coverage-ignore-block(suite): Not run.
// The type of the expression is known precisely, so an implicit
// downcast is guaranteed to fail. Insert a compile-time error.
assert(implicitInstantiation == null);
@@ -948,7 +957,9 @@
TypeConstraintGatherer gatherer = typeSchemaEnvironment
.setupGenericTypeInference(null, typeParameters, null,
typeOperations: cfeOperations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: treeNodeForTesting);
gatherer.constrainArguments([onType], [receiverType],
treeNodeForTesting: treeNodeForTesting);
@@ -1093,6 +1104,7 @@
classMemberKind = ClassMemberKind.Getter;
case ProcedureKind.Setter:
classMemberKind = ClassMemberKind.Setter;
+ // Coverage-ignore(suite): Not run.
case ProcedureKind.Factory:
case null:
throw new UnsupportedError(
@@ -1116,6 +1128,7 @@
isPlatform:
extensionBuilder.libraryBuilder.importUri.isScheme('dart'));
if (noneMoreSpecific.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
bool isMostSpecific = true;
for (ExtensionAccessCandidate other in noneMoreSpecific) {
bool? isMoreSpecific =
@@ -1212,6 +1225,7 @@
} else if (receiverBound is ExtensionType &&
name.text ==
receiverBound.extensionTypeDeclaration.representationName) {
+ // Coverage-ignore-block(suite): Not run.
ObjectAccessTarget target =
objectAccessDescriptor.findNonExtensionTarget(this);
if (!target.isMissing) {
@@ -1295,7 +1309,9 @@
DartType getGetterTypeForMemberTarget(
Member interfaceMember, DartType receiverType,
{required bool isSuper}) {
- assert(interfaceMember is Field || interfaceMember is Procedure,
+ assert(
+ interfaceMember is Field || interfaceMember is Procedure,
+ // Coverage-ignore(suite): Not run.
"Unexpected interface member $interfaceMember.");
DartType calleeType =
isSuper ? interfaceMember.superGetterType : interfaceMember.getterType;
@@ -1317,7 +1333,9 @@
DartType getSetterTypeForMemberTarget(
Member interfaceMember, DartType receiverType,
{required bool isSuper}) {
- assert(interfaceMember is Field || interfaceMember is Procedure,
+ assert(
+ interfaceMember is Field || interfaceMember is Procedure,
+ // Coverage-ignore(suite): Not run.
"Unexpected interface member $interfaceMember.");
DartType calleeType =
isSuper ? interfaceMember.superSetterType : interfaceMember.setterType;
@@ -1620,7 +1638,9 @@
gatherer = typeSchemaEnvironment.setupGenericTypeInference(
calleeType.returnType, calleeTypeParameters, typeContext,
typeOperations: cfeOperations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: arguments);
inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, calleeTypeParameters, null);
@@ -1712,6 +1732,7 @@
Object? argument = argumentsEvaluationOrder[evaluationOrderIndex];
assert(
argument is Expression || argument is NamedExpression,
+ // Coverage-ignore(suite): Not run.
"Expected the argument to be either an Expression "
"or a NamedExpression, got '${argument.runtimeType}'.");
int index;
@@ -1827,10 +1848,12 @@
}
assert(
positionalIndex == arguments.positional.length,
+ // Coverage-ignore(suite): Not run.
"Expected 'positionalIndex' to be ${arguments.positional.length}, "
"got ${positionalIndex}.");
assert(
namedIndex == arguments.named.length,
+ // Coverage-ignore(suite): Not run.
"Expected 'namedIndex' to be ${arguments.named.length}, "
"got ${namedIndex}.");
@@ -1897,9 +1920,13 @@
if (inferenceNeeded) {
inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer!, calleeTypeParameters, inferredTypes!);
- assert(inferredTypes.every((type) => isKnown(type)),
+ assert(
+ inferredTypes.every((type) => isKnown(type)),
+ // Coverage-ignore(suite): Not run.
"Unknown type(s) in inferred types: $inferredTypes.");
- assert(inferredTypes.every((type) => !hasPromotedTypeVariable(type)),
+ assert(
+ inferredTypes.every((type) => !hasPromotedTypeVariable(type)),
+ // Coverage-ignore(suite): Not run.
"Promoted type variable(s) in inferred types: $inferredTypes.");
instantiator = new FunctionTypeInstantiator.fromIterables(
calleeTypeParameters, inferredTypes);
@@ -1908,6 +1935,7 @@
arguments.types.clear();
arguments.types.addAll(inferredTypes);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(arguments.fileOffset != TreeNode.noOffset);
dataForTesting!.typeInferenceResult.inferredTypeArguments[arguments] =
inferredTypes;
@@ -1987,6 +2015,7 @@
inferredType = calleeType.returnType;
assert(
!containsFreeFunctionTypeVariables(inferredType),
+ // Coverage-ignore(suite): Not run.
"Inferred return type $inferredType contains free variables. "
"Inferred function type: $calleeType.");
@@ -2094,6 +2123,7 @@
if (formalTypesFromContext[i] != null) {
inferredType = computeGreatestClosure2(
instantiator?.substitute(formalTypesFromContext[i]!) ??
+ // Coverage-ignore(suite): Not run.
formalTypesFromContext[i]!);
if (typeSchemaEnvironment.isSubtypeOf(inferredType, const NullType(),
SubtypeCheckMode.withNullabilities)) {
@@ -2106,6 +2136,7 @@
'type', new InstrumentationValueForType(inferredType));
formal.type = demoteTypeInLibrary(inferredType);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
dataForTesting!.typeInferenceResult.inferredVariableTypes[formal] =
formal.type;
}
@@ -2355,6 +2386,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
staticInvocation,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
result = wrapExpressionInferenceResultInProblem(
result,
@@ -2383,6 +2415,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
staticInvocation,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
if (isImplicitCall) {
// Handles cases like:
@@ -2482,6 +2515,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
expression,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
if (isImplicitCall) {
// Handles cases like:
@@ -2540,7 +2574,9 @@
Procedure? method = target.classMember as Procedure;
assert(
method.kind == ProcedureKind.Method ||
+ // Coverage-ignore(suite): Not run.
method.kind == ProcedureKind.Operator,
+ // Coverage-ignore(suite): Not run.
"Unexpected instance method $method");
Name methodName = method.name;
@@ -2552,8 +2588,9 @@
method = null;
}
for (NamedExpression argument in arguments.named) {
- if (!signature.namedParameters
- .any((declaration) => declaration.name == argument.name)) {
+ if (!signature.namedParameters.any(
+ // Coverage-ignore(suite): Not run.
+ (declaration) => declaration.name == argument.name)) {
target = const ObjectAccessTarget.dynamic();
method = null;
}
@@ -2604,6 +2641,7 @@
assert(
inferredFunctionType is FunctionType &&
!identical(unknownFunction, inferredFunctionType),
+ // Coverage-ignore(suite): Not run.
"No function type found for $receiver.$methodName ($target) on "
"$receiverType");
InstanceAccessKind kind;
@@ -2617,6 +2655,7 @@
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $target');
}
@@ -2650,6 +2689,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
expression,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
if (isImplicitCall) {
// Handles cases like:
@@ -2710,6 +2750,7 @@
getter = null;
}
for (NamedExpression argument in arguments.named) {
+ // Coverage-ignore-block(suite): Not run.
if (!signature.namedParameters
.any((declaration) => declaration.name == argument.name)) {
target = const ObjectAccessTarget.dynamic();
@@ -2746,6 +2787,7 @@
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $target');
}
@@ -2758,6 +2800,7 @@
receiver is! ThisExpression &&
returnedTypeParametersOccurNonCovariantly(
getter.enclosingTypeDeclaration!, getter.function.returnType)) {
+ // Coverage-ignore-block(suite): Not run.
propertyGet = new AsExpression(propertyGet, calleeType)
..isTypeError = true
..isCovarianceCheck = true
@@ -2803,6 +2846,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
invocationResult.expression,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
invocationResult = wrapExpressionInferenceResultInProblem(
invocationResult,
@@ -2818,7 +2862,9 @@
// getter calls.
Expression nullAwareAction = invocationResult.nullAwareAction;
if (nullAwareAction is InstanceInvocation &&
+ // Coverage-ignore(suite): Not run.
nullAwareAction.receiver == originalPropertyGet) {
+ // Coverage-ignore-block(suite): Not run.
invocationResult = new ExpressionInferenceResult(
invocationResult.inferredType,
new InstanceGetterInvocation(originalPropertyGet.kind,
@@ -2924,9 +2970,11 @@
case ObjectAccessTargetKind.nullableInstanceMember:
kind = InstanceAccessKind.Nullable;
break;
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $target');
}
@@ -3001,6 +3049,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
whyNotPromoted!(),
invocationResult.expression,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
invocationResult = wrapExpressionInferenceResultInProblem(
invocationResult,
@@ -3025,7 +3074,9 @@
functionType: nullAwareAction.functionType)
..fileOffset = nullAwareAction.fileOffset);
} else if (nullAwareAction is DynamicInvocation &&
+ // Coverage-ignore(suite): Not run.
nullAwareAction.receiver == originalPropertyGet) {
+ // Coverage-ignore-block(suite): Not run.
invocationResult = new ExpressionInferenceResult(
invocationResult.inferredType,
new InstanceGetterInvocation(originalPropertyGet.kind, receiver,
@@ -3200,6 +3251,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
receiver,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
readResult = wrapExpressionInferenceResultInProblem(
readResult,
@@ -3239,6 +3291,7 @@
List<LocatedMessage>? context = getWhyNotPromotedContext(
flowAnalysis.whyNotPromoted(receiver)(),
receiver,
+ // Coverage-ignore(suite): Not run.
(type) => !type.isPotentiallyNullable);
readResult = wrapExpressionInferenceResultInProblem(
readResult,
@@ -3260,6 +3313,7 @@
isImplicitCall: true,
hoistedExpressions: hoistedExpressions);
case ObjectAccessTargetKind.extensionTypeRepresentation:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.nullableExtensionTypeRepresentation:
DartType type = target.getGetterType(this);
type = flowAnalysis.propertyGet(
@@ -3276,6 +3330,7 @@
ExpressionInferenceResult readResult =
new ExpressionInferenceResult(type, read);
if (target.isNullable) {
+ // Coverage-ignore-block(suite): Not run.
// Handles cases like:
//
// extension type Foo(void Function() bar) {}
@@ -3326,6 +3381,7 @@
Member? interfaceTarget;
Name actualMethodName;
if (calleeType is InterfaceType) {
+ // Coverage-ignore-block(suite): Not run.
actualReceiverType = calleeType;
interfaceTarget = null;
actualMethodName = callName;
@@ -3421,6 +3477,7 @@
DartType? promotedType = flowAnalysis.propertyGet(expression,
SuperPropertyTarget.singleton, name.text, member, inferredType);
if (promotedType != null) {
+ // Coverage-ignore-block(suite): Not run.
expression = new AsExpression(expression, promotedType)
..isUnchecked = true
..fileOffset = expression.fileOffset;
@@ -3448,7 +3505,9 @@
typeSchemaEnvironment.setupGenericTypeInference(
instantiatedType, typeParameters, context,
typeOperations: cfeOperations,
- inferenceResultForTesting: dataForTesting?.typeInferenceResult,
+ inferenceResultForTesting: dataForTesting
+ // Coverage-ignore(suite): Not run.
+ ?.typeInferenceResult,
treeNodeForTesting: treeNodeForTesting);
inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParameters, inferredTypes);
@@ -3573,6 +3632,7 @@
if (interfaceMember is Field ||
interfaceMember is Procedure &&
interfaceMember.kind == ProcedureKind.Getter) {
+ // Coverage-ignore-block(suite): Not run.
DartType getType = target.getGetterType(this);
if (getType is DynamicType) {
return MethodContravarianceCheckKind.none;
@@ -3632,6 +3692,7 @@
// futureValueTypeSchema(_) = _.
return node;
}
+ // Coverage-ignore-block(suite): Not run.
throw new UnsupportedError("Unsupported type '${node.runtimeType}'.");
}), coreTypes);
}
@@ -3695,6 +3756,7 @@
if (expression is StaticGet) {
Member target = expression.target;
if (target is Procedure && target.kind == ProcedureKind.Method) {
+ // Coverage-ignore-block(suite): Not run.
if (target.enclosingClass != null) {
return templateInvalidCastStaticMethod;
} else {
@@ -3840,6 +3902,7 @@
fileOffset,
implicitInvocationPropertyName.text.length);
} else {
+ // Coverage-ignore-block(suite): Not run.
return helper.buildProblem(
templateInvokeNonFunction
.withArguments(implicitInvocationPropertyName.text),
@@ -3875,8 +3938,10 @@
Expression read;
ExpressionInferenceResult? readResult;
+ // Coverage-ignore(suite): Not run.
readTarget ??= findInterfaceMember(receiverType, propertyName, fileOffset,
includeExtensionMethods: true, isSetter: false);
+ // Coverage-ignore(suite): Not run.
readType ??= readTarget.getGetterType(this);
switch (readTarget.kind) {
@@ -3913,6 +3978,7 @@
..fileOffset = fileOffset;
readResult = instantiateTearOff(readType, typeContext, read);
break;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
unhandled('$readTarget', "inferPropertyGet", -1, null);
}
@@ -3956,6 +4022,7 @@
case ObjectAccessTargetKind.objectMember:
kind = InstanceAccessKind.Object;
break;
+ // Coverage-ignore(suite): Not run.
default:
throw new UnsupportedError('Unexpected target kind $readTarget');
}
@@ -4018,6 +4085,7 @@
..fileOffset = fileOffset;
break;
case ObjectAccessTargetKind.extensionTypeRepresentation:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.nullableExtensionTypeRepresentation:
read = new AsExpression(receiver, readType)
..isUnchecked = true
@@ -4042,7 +4110,9 @@
propertyName.text.length,
context: whyNotPromoted != null
? getWhyNotPromotedContext(
- whyNotPromoted(), read, (type) => !type.isPotentiallyNullable)
+ whyNotPromoted(),
+ read, // Coverage-ignore(suite): Not run.
+ (type) => !type.isPotentiallyNullable)
: null);
}
return new PropertyGetInferenceResult(readResult, readTarget.member);
@@ -4190,6 +4260,7 @@
BigInt asInt = new BigInt.from(value).toUnsigned(64);
BigInt asDouble = new BigInt.from(asInt.toDouble());
if (asInt == asDouble) return null;
+ // Coverage-ignore-block(suite): Not run.
String text = literal ?? value.toString();
String nearest = text.startsWith('0x') || text.startsWith('0X')
? '0x${asDouble.toRadixString(16)}'
@@ -4264,6 +4335,7 @@
typeParameters: functionType.typeParameters);
}
+// Coverage-ignore(suite): Not run.
class _WhyNotPromotedVisitor
implements
NonPromotionReasonVisitor<List<LocatedMessage>, Node,
@@ -4559,10 +4631,12 @@
FunctionNode function = interfaceMember.function;
assert(
function.namedParameters.isEmpty,
+ // Coverage-ignore(suite): Not run.
"Unexpected named parameters on $classNode member "
"$interfaceMember.");
assert(
function.typeParameters.isEmpty,
+ // Coverage-ignore(suite): Not run.
"Unexpected type parameters on $classNode member "
"$interfaceMember.");
functionType = new FunctionType(
@@ -4576,10 +4650,12 @@
functionType: functionType,
);
case Nullability.nullable:
+ // Coverage-ignore(suite): Not run.
case Nullability.legacy:
// Never? and Never* are equivalent to Null.
return visitor.findInterfaceMember(const NullType(), name, fileOffset,
isSetter: isSetter);
+ // Coverage-ignore(suite): Not run.
case Nullability.undetermined:
return internalProblem(
templateInternalProblemUnsupportedNullability.withArguments(
@@ -4710,6 +4786,7 @@
case ObjectAccessTargetKind.nullableRecordIndexed:
case ObjectAccessTargetKind.nullableRecordNamed:
case ObjectAccessTargetKind.nullableExtensionTypeMember:
+ // Coverage-ignore(suite): Not run.
case ObjectAccessTargetKind.nullableExtensionTypeRepresentation:
return false;
}
diff --git a/pkg/front_end/lib/src/type_inference/matching_cache.dart b/pkg/front_end/lib/src/type_inference/matching_cache.dart
index 50ab193..dfb2a0b 100644
--- a/pkg/front_end/lib/src/type_inference/matching_cache.dart
+++ b/pkg/front_end/lib/src/type_inference/matching_cache.dart
@@ -91,6 +91,7 @@
if (jointVariable != null) {
_variableAliases[variable] = jointVariable;
} else {
+ // Coverage-ignore-block(suite): Not run.
// Error case. This variable is only declared one of the branches and
// therefore not joint. Include the variable in the declarations.
registerDeclaration(variable);
@@ -145,7 +146,9 @@
return _cacheKeyMap[cacheKey] = new Cache(
cacheKey,
this,
- '${useVerboseEncodingForDebugging ? '${cacheKey.name}' : ''}'
+ '${useVerboseEncodingForDebugging ?
+ // Coverage-ignore(suite): Not run.
+ '${cacheKey.name}' : ''}'
'#${this._matchingCacheIndex}'
'#${_cachedExpressionIndex++}',
isLate: isLate,
@@ -305,7 +308,9 @@
required int fileOffset}) {
CacheKey cacheKey;
if (staticTarget != null) {
- assert(typeArguments != null,
+ assert(
+ typeArguments != null,
+ // Coverage-ignore(suite): Not run.
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(
receiver.cacheKey, staticTarget, typeArguments!, propertyName);
@@ -329,7 +334,9 @@
required int fileOffset}) {
CacheKey cacheKey;
if (staticTarget != null) {
- assert(typeArguments != null,
+ assert(
+ typeArguments != null,
+ // Coverage-ignore(suite): Not run.
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(left.cacheKey, staticTarget,
typeArguments!, operator, [right.cacheKey]);
@@ -355,6 +362,7 @@
required int fileOffset}) {
CacheKey cacheKey;
if (staticTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeArguments != null,
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(left.cacheKey, staticTarget,
@@ -398,6 +406,7 @@
required int fileOffset}) {
CacheKey cacheKey;
if (staticTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeArguments != null,
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(receiver.cacheKey, staticTarget,
@@ -427,6 +436,7 @@
const String propertyName = 'tail[]';
CacheKey cacheKey;
if (staticTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeArguments != null,
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(receiver.cacheKey, staticTarget,
@@ -460,6 +470,7 @@
const String propertyName = 'sublist[]';
CacheKey cacheKey;
if (staticTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeArguments != null,
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(
@@ -490,6 +501,7 @@
required int fileOffset}) {
CacheKey cacheKey;
if (staticTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeArguments != null,
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(receiver.cacheKey, staticTarget,
@@ -516,6 +528,7 @@
required int fileOffset}) {
CacheKey cacheKey;
if (staticTarget != null) {
+ // Coverage-ignore-block(suite): Not run.
assert(typeArguments != null,
"No type arguments provided for static target $staticTarget.");
cacheKey = new StaticAccessKey(receiver.cacheKey, staticTarget,
@@ -567,6 +580,7 @@
ExpressionKey(this.expression);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '${expression.toText(defaultAstTextStrategy)}';
@override
@@ -586,6 +600,7 @@
ConstantKey(this.constant);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '${constant.toText(defaultAstTextStrategy)}';
@override
@@ -605,6 +620,7 @@
IntegerKey(this.value);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '$value';
@override
@@ -625,6 +641,7 @@
IsKey(this.receiver, this.type);
@override
+ // Coverage-ignore(suite): Not run.
String get name =>
'${receiver.name}_is_${type.toText(defaultAstTextStrategy)}';
@@ -646,6 +663,7 @@
AsKey(this.receiver, this.type);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '${receiver.name}_as_${type}';
@override
@@ -665,6 +683,7 @@
NullCheckKey(this.operand);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '${operand.name}?';
@override
@@ -684,6 +703,7 @@
NullAssertKey(this.operand);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '${operand.name}!';
@override
@@ -706,6 +726,7 @@
DynamicAccessKey(this.receiver, this.propertyName, [this.arguments]);
@override
+ // Coverage-ignore(suite): Not run.
String get name {
StringBuffer sb = new StringBuffer();
sb.write('${receiver.name}_${propertyName}');
@@ -745,6 +766,7 @@
[this.arguments]);
@override
+ // Coverage-ignore(suite): Not run.
String get name {
StringBuffer sb = new StringBuffer();
sb.write('${receiver.name}_${target}_${typeArguments}');
@@ -784,6 +806,7 @@
AndKey(this.left, this.right);
@override
+ // Coverage-ignore(suite): Not run.
String get name => '${left.name}_&&_${right.name}';
@override
@@ -891,6 +914,7 @@
@override
CacheableExpression promote(DartType type) {
if (type == _promotedType) return this;
+ // Coverage-ignore(suite): Not run.
return new PromotedCacheableExpression(_expression, type);
}
}
@@ -910,6 +934,7 @@
{required this.fileOffset});
@override
+ // Coverage-ignore(suite): Not run.
CacheKey get cacheKey => _expression.cacheKey;
@override
@@ -938,12 +963,14 @@
@override
bool uses(DelayedExpression expression) {
+ // Coverage-ignore-block(suite): Not run.
return identical(this, expression) || _expression.uses(expression);
}
@override
CacheableExpression promote(DartType type) {
if (type == _checkedType) return this;
+ // Coverage-ignore(suite): Not run.
return new PromotedCacheableExpression(_expression, type);
}
}
@@ -1115,6 +1142,7 @@
..isLate = _isLate
..name = _name;
if (_isLate) {
+ // Coverage-ignore-block(suite): Not run.
// Avoid step debugging on the declaration of caching variables.
// TODO(johnniwinther): Find a more systematic way of omitting
// offsets for better step debugging.
@@ -1124,7 +1152,9 @@
}
result = createVariableGet(variable)..fileOffset = TreeNode.noOffset;
} else {
- assert(_isLate, "Unexpected non-late cache ${cacheKey.name}");
+ assert(
+ _isLate, // Coverage-ignore(suite): Not run.
+ "Unexpected non-late cache ${cacheKey.name}");
VariableDeclaration? variable = _variable;
VariableDeclaration? isSetVariable = _isSetVariable;
diff --git a/pkg/front_end/lib/src/type_inference/matching_expressions.dart b/pkg/front_end/lib/src/type_inference/matching_expressions.dart
index 2b49d1f..469d342 100644
--- a/pkg/front_end/lib/src/type_inference/matching_expressions.dart
+++ b/pkg/front_end/lib/src/type_inference/matching_expressions.dart
@@ -322,6 +322,7 @@
fileOffset: entry.fileOffset),
fileOffset: entry.fileOffset);
} else {
+ // Coverage-ignore-block(suite): Not run.
matchingExpression = DelayedAndExpression.merge(
matchingExpression, containsExpression,
fileOffset: entry.fileOffset);
@@ -342,6 +343,7 @@
fileOffset: node.fileOffset);
}
}
+ // Coverage-ignore(suite): Not run.
return matchingExpression ??
new BooleanExpression(true, fileOffset: node.fileOffset);
}
@@ -432,6 +434,7 @@
fileOffset: field.fileOffset);
break;
case ObjectAccessKind.Never:
+ // Coverage-ignore(suite): Not run.
expression = new DelayedDynamicGet(
typedMatchedExpression,
field.fieldName,
@@ -550,6 +553,7 @@
fileOffset: node.fileOffset);
}
+ // Coverage-ignore(suite): Not run.
return matchingExpression ??
new BooleanExpression(true, fileOffset: node.fileOffset);
}
@@ -662,6 +666,7 @@
if (node.subPattern != null) {
return visitPattern(node.subPattern!, matchedExpression);
}
+ // Coverage-ignore-block(suite): Not run.
throw new UnsupportedError("RestPattern without subpattern.");
}
diff --git a/pkg/front_end/lib/src/type_inference/object_access_target.dart b/pkg/front_end/lib/src/type_inference/object_access_target.dart
index 970deac..631841c 100644
--- a/pkg/front_end/lib/src/type_inference/object_access_target.dart
+++ b/pkg/front_end/lib/src/type_inference/object_access_target.dart
@@ -179,19 +179,24 @@
// TODO(johnniwinther): Unify stub kinds. Should we always make this a
// member signature, merge member signature and abstract forwarding stub,
// or add a new stub kind for abstract extension type members?
- assert(member.enclosingExtensionTypeDeclaration != null,
+ assert(
+ member.enclosingExtensionTypeDeclaration != null,
+ // Coverage-ignore(suite): Not run.
"Unexpected member without an enclosing class $member.");
member = (member as Procedure).stubTarget!;
}
assert(
- member.enclosingClass != null, "No enclosing class found on $member.");
+ member.enclosingClass != null, // Coverage-ignore(suite): Not run.
+ "No enclosing class found on $member.");
return member;
}
+ // Coverage-ignore(suite): Not run.
/// The access index, if this is an access to a positional record field.
/// Otherwise null.
int? get recordFieldIndex => null;
+ // Coverage-ignore(suite): Not run.
/// The access name, if this is an access to a named record field.
/// Otherwise null.
String? get recordFieldName => null;
@@ -277,10 +282,12 @@
isNullableExtensionTypeMember ||
isNullableExtensionTypeRepresentation;
+ // Coverage-ignore(suite): Not run.
/// Returns the candidates for an ambiguous extension access.
List<ExtensionAccessCandidate> get candidates =>
throw new UnsupportedError('ObjectAccessTarget.candidates');
+ // Coverage-ignore(suite): Not run.
/// Returns the original procedure kind, if this is an extension method or
/// extension type method target.
///
@@ -290,12 +297,14 @@
ClassMemberKind get declarationMethodKind =>
throw new UnsupportedError('ObjectAccessTarget.declarationMethodKind');
+ // Coverage-ignore(suite): Not run.
/// Returns type arguments for the type parameters of an extension or
/// extension type method that comes from the extension or extension type
/// declaration. These are determined from the receiver of the access.
List<DartType> get receiverTypeArguments =>
throw new UnsupportedError('ObjectAccessTarget.receiverTypeArguments');
+ // Coverage-ignore(suite): Not run.
/// Returns the member to use for a tearoff.
///
/// This is currently used for extension methods.
@@ -371,6 +380,7 @@
/// operand is of type `int` and `num` otherwise.
bool isSpecialCasedBinaryOperator(InferenceVisitorBase base) => false;
+ // Coverage-ignore(suite): Not run.
/// Returns `true` if this target is ternary operator, whose return type is
/// specialized to take the operand type into account.
///
@@ -581,27 +591,32 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getSetterType(InferenceVisitorBase base) {
assert(false, "Unexpected call to ${runtimeType}.getSetterType");
return const DynamicType();
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getIndexKeyType(InferenceVisitorBase base) {
return const DynamicType();
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getIndexSetValueType(InferenceVisitorBase base) {
return const DynamicType();
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getReturnType(InferenceVisitorBase base) {
return getFunctionType(base).returnType;
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getBinaryOperandType(InferenceVisitorBase base) {
return const DynamicType();
}
@@ -610,21 +625,25 @@
class DynamicAccessTarget extends ObjectAccessTarget {
/// Creates an access on a dynamic receiver type with no known target.
const DynamicAccessTarget.dynamic()
- : super.internal(ObjectAccessTargetKind.dynamic);
+ : super // Coverage-ignore(suite): Not run.
+ .internal(ObjectAccessTargetKind.dynamic);
/// Creates an access with no target due to an invalid receiver type.
///
/// This is not in itself an error but a consequence of another error.
const DynamicAccessTarget.invalid()
- : super.internal(ObjectAccessTargetKind.invalid);
+ : super // Coverage-ignore(suite): Not run.
+ .internal(ObjectAccessTargetKind.invalid);
/// Creates an access with no target.
///
/// This is an error case.
const DynamicAccessTarget.missing()
- : super.internal(ObjectAccessTargetKind.missing);
+ : super // Coverage-ignore(suite): Not run.
+ .internal(ObjectAccessTargetKind.missing);
@override
+ // Coverage-ignore(suite): Not run.
DartType? get receiverType => null;
@override
@@ -679,11 +698,13 @@
: super.internal(ObjectAccessTargetKind.never);
@override
+ // Coverage-ignore(suite): Not run.
DartType? get receiverType => null;
@override
FunctionType getFunctionType(InferenceVisitorBase base) {
- return functionType ?? base.unknownFunction;
+ return functionType ?? // Coverage-ignore(suite): Not run.
+ base.unknownFunction;
}
@override
@@ -746,6 +767,7 @@
case ClassMemberKind.Getter:
// TODO(johnniwinther): Handle implicit .call on extension getter.
return _getFunctionType(base, member.function!.returnType);
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
throw unexpected('$this', 'getFunctionType', -1, null);
}
@@ -786,6 +808,7 @@
extensionTypeParameters, receiverTypeArguments);
DartType resultType = instantiator.substitute(functionType.returnType);
return resultType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
throw unexpected('$this', 'getGetterType', -1, null);
}
@@ -807,6 +830,7 @@
DartType setterType =
instantiator.substitute(functionType.positionalParameters[1]);
return setterType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Method:
case ClassMemberKind.Getter:
throw unexpected('$this', 'getSetterType', -1, null);
@@ -830,6 +854,7 @@
return keyType;
}
return const InvalidType();
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
case ClassMemberKind.Setter:
throw unexpected('$this', 'getIndexKeyType', -1, null);
@@ -853,6 +878,7 @@
return indexType;
}
return const InvalidType();
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
case ClassMemberKind.Setter:
throw unexpected('$this', 'getIndexSetValueType', -1, null);
@@ -863,6 +889,7 @@
DartType getReturnType(InferenceVisitorBase base) {
switch (declarationMethodKind) {
case ClassMemberKind.Method:
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
FunctionType functionType =
member.function!.computeFunctionType(Nullability.nonNullable);
@@ -874,6 +901,7 @@
returnType = instantiator.substitute(returnType);
}
return returnType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
return const VoidType();
}
@@ -888,6 +916,7 @@
if (functionType.positionalParameters.length > 1) {
DartType keyType = functionType.positionalParameters[1];
if (functionType.typeParameters.isNotEmpty) {
+ // Coverage-ignore-block(suite): Not run.
FunctionTypeInstantiator instantiator =
new FunctionTypeInstantiator.fromIterables(
functionType.typeParameters, receiverTypeArguments);
@@ -896,6 +925,7 @@
return keyType;
}
return const InvalidType();
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
case ClassMemberKind.Setter:
return const InvalidType();
@@ -922,6 +952,7 @@
Member? get member => null;
@override
+ // Coverage-ignore(suite): Not run.
FunctionType getFunctionType(InferenceVisitorBase base) {
return base.unknownFunction;
}
@@ -1002,7 +1033,9 @@
return false;
}
}
- } else if (other.isPlatform) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (other.isPlatform) {
// This is not platform, [other] is: this is more specific.
return true;
} else {
@@ -1025,11 +1058,13 @@
: super.internal(kind);
@override
+ // Coverage-ignore(suite): Not run.
DartType getBinaryOperandType(InferenceVisitorBase base) {
return const DynamicType();
}
@override
+ // Coverage-ignore(suite): Not run.
FunctionType getFunctionType(InferenceVisitorBase base) {
return _getFunctionType(base, getGetterType(base));
}
@@ -1040,21 +1075,25 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getIndexKeyType(InferenceVisitorBase base) {
throw unexpected(runtimeType.toString(), 'getIndexKeyType', -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getIndexSetValueType(InferenceVisitorBase base) {
throw unexpected(runtimeType.toString(), 'getIndexSetValueType', -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getReturnType(InferenceVisitorBase base) {
return getFunctionType(base).returnType;
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getSetterType(InferenceVisitorBase base) {
throw unexpected(runtimeType.toString(), 'getSetterType', -1, null);
}
@@ -1120,9 +1159,11 @@
FunctionType functionType =
member.function!.computeFunctionType(Nullability.nonNullable);
return functionType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
// TODO(johnniwinther): Handle implicit .call on extension getter.
return _getFunctionType(base, member.function!.returnType);
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
throw unexpected('$this', 'getFunctionType', -1, null);
}
@@ -1163,6 +1204,7 @@
extensionTypeParameters, receiverTypeArguments);
DartType resultType = instantiator.substitute(functionType.returnType);
return resultType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
throw unexpected('$this', 'getGetterType', -1, null);
}
@@ -1184,6 +1226,7 @@
DartType setterType =
instantiator.substitute(functionType.positionalParameters[1]);
return setterType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Method:
case ClassMemberKind.Getter:
throw unexpected('$this', 'getSetterType', -1, null);
@@ -1207,6 +1250,7 @@
return keyType;
}
return const InvalidType();
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
case ClassMemberKind.Setter:
throw unexpected('$this', 'getIndexKeyType', -1, null);
@@ -1230,6 +1274,7 @@
return indexType;
}
return const InvalidType();
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
case ClassMemberKind.Setter:
throw unexpected('$this', 'getIndexSetValueType', -1, null);
@@ -1240,6 +1285,7 @@
DartType getReturnType(InferenceVisitorBase base) {
switch (declarationMethodKind) {
case ClassMemberKind.Method:
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
FunctionType functionType =
member.function!.computeFunctionType(Nullability.nonNullable);
@@ -1251,6 +1297,7 @@
returnType = instantiator.substitute(returnType);
}
return returnType;
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Setter:
return const VoidType();
}
@@ -1273,6 +1320,7 @@
return keyType;
}
return const InvalidType();
+ // Coverage-ignore(suite): Not run.
case ClassMemberKind.Getter:
case ClassMemberKind.Setter:
return const InvalidType();
@@ -1299,11 +1347,13 @@
: ObjectAccessTargetKind.nullableExtensionTypeRepresentation);
@override
+ // Coverage-ignore(suite): Not run.
DartType getBinaryOperandType(InferenceVisitorBase base) {
throw unexpected('$this', 'getBinaryOperandType', -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
FunctionType getFunctionType(InferenceVisitorBase base) {
return _getFunctionType(base, getGetterType(base));
}
@@ -1315,21 +1365,25 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getIndexKeyType(InferenceVisitorBase base) {
throw unexpected('$this', 'getIndexKeyType', -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getIndexSetValueType(InferenceVisitorBase base) {
throw unexpected('$this', 'getIndexSetValueType', -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getReturnType(InferenceVisitorBase base) {
throw unexpected('$this', 'getReturnType', -1, null);
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getSetterType(InferenceVisitorBase base) {
throw unexpected('$this', 'getSetterType', -1, null);
}
diff --git a/pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart b/pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart
index 01c4fb7..4ab4768 100644
--- a/pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart
+++ b/pkg/front_end/lib/src/type_inference/shared_type_analyzer.dart
@@ -46,7 +46,9 @@
nullSafetyEnabled
? templateSwitchExpressionNotSubtype.withArguments(
caseExpressionType, scrutineeType)
- : templateSwitchExpressionNotAssignable.withArguments(
+ :
+ // Coverage-ignore(suite): Not run.
+ templateSwitchExpressionNotAssignable.withArguments(
scrutineeType, caseExpressionType),
caseExpression.fileOffset,
noLength,
diff --git a/pkg/front_end/lib/src/type_inference/standard_bounds.dart b/pkg/front_end/lib/src/type_inference/standard_bounds.dart
index 84a2eff..da1b542 100644
--- a/pkg/front_end/lib/src/type_inference/standard_bounds.dart
+++ b/pkg/front_end/lib/src/type_inference/standard_bounds.dart
@@ -26,6 +26,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getNullabilityObliviousStandardLowerBoundInternal(type1, type2) {
// For any type T, SLB(?, T) = SLB(T, ?) = T.
if (type1 is UnknownType) {
@@ -54,6 +55,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
DartType getNullabilityObliviousStandardUpperBoundInternal(
DartType type1, DartType type2) {
// For any type T, SUB(?, T) = SUB(T, ?) = T.
diff --git a/pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart b/pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart
index c717971..50465a9 100644
--- a/pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart
+++ b/pkg/front_end/lib/src/type_inference/type_constraint_gatherer.dart
@@ -53,6 +53,7 @@
}
}
+ // Coverage-ignore(suite): Not run.
Member? getInterfaceMember(Class class_, Name name, {bool setter = false}) {
return _environment.hierarchy
.getInterfaceMember(class_, name, setter: setter);
@@ -99,6 +100,7 @@
constrainSupertype: false, treeNodeForTesting: treeNodeForTesting);
}
+ // Coverage-ignore(suite): Not run.
/// Tries to match [subtype] against [supertype].
///
/// If the match succeeds, the member returns true, and the resulting type
@@ -151,6 +153,7 @@
GeneratedTypeConstraint generatedTypeConstraint =
new GeneratedTypeConstraint.lower(parameter, lower);
if (treeNodeForTesting != null && _inferenceResultForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
(_inferenceResultForTesting
.generatedTypeConstraints[treeNodeForTesting] ??= [])
.add(generatedTypeConstraint);
@@ -164,6 +167,7 @@
GeneratedTypeConstraint generatedTypeConstraint =
new GeneratedTypeConstraint.upper(parameter, upper);
if (treeNodeForTesting != null && _inferenceResultForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
(_inferenceResultForTesting
.generatedTypeConstraints[treeNodeForTesting] ??= [])
.add(generatedTypeConstraint);
@@ -171,6 +175,7 @@
_protoConstraints.add(generatedTypeConstraint);
}
+ // Coverage-ignore(suite): Not run.
bool _isFunctionSubtypeMatch(FunctionType subtype, FunctionType supertype,
{required TreeNode? treeNodeForTesting}) {
// A function type `(M0,..., Mn, [M{n+1}, ..., Mm]) -> R0` is a subtype
@@ -254,6 +259,7 @@
return true;
}
+ // Coverage-ignore(suite): Not run.
/// Whether the [subtype] interface is a subtype of the [supertype] interface
/// with respect to variance.
bool _isNullabilityObliviousInterfaceSubtypeMatch(
@@ -338,7 +344,9 @@
unhandledTypeHandler: (DartType type, ignored) =>
type is UnknownType
? false
- : throw new UnsupportedError(
+ :
+ // Coverage-ignore(suite): Not run.
+ throw new UnsupportedError(
"Unsupported type '${type.runtimeType}'.")),
"Failed implication check: "
"constrainSupertype -> !containsTypeVariable(q)");
@@ -371,7 +379,9 @@
unhandledTypeHandler: (DartType type, ignored) =>
type is UnknownType
? false
- : throw new UnsupportedError(
+ :
+ // Coverage-ignore(suite): Not run.
+ throw new UnsupportedError(
"Unsupported type '${type.runtimeType}'.")),
"Failed implication check: "
"!constrainSupertype -> !containsTypeVariable(q)");
@@ -424,6 +434,7 @@
//
// Only if P0 is a subtype match for Q under constraint set C.
if (pNullability == NullabilitySuffix.star) {
+ // Coverage-ignore-block(suite): Not run.
return _isNullabilityAwareSubtypeMatch(
typeOperations.withNullabilitySuffix(p, NullabilitySuffix.none), q,
constrainSupertype: constrainSupertype,
@@ -437,6 +448,7 @@
// Or if P is not dynamic or void and P is a subtype match for Q0? under
// constraint set C.
if (qNullability == NullabilitySuffix.star) {
+ // Coverage-ignore-block(suite): Not run.
final int baseConstraintCount = _protoConstraints.length;
if ((p is SharedDynamicType || p is SharedVoidType) &&
@@ -567,6 +579,7 @@
if (_isNullabilityAwareSubtypeMatch(typeOperations.futureType(p0), q,
constrainSupertype: constrainSupertype,
treeNodeForTesting: treeNodeForTesting) &&
+ // Coverage-ignore(suite): Not run.
_isNullabilityAwareSubtypeMatch(p0, q,
constrainSupertype: constrainSupertype,
treeNodeForTesting: treeNodeForTesting)) {
@@ -627,6 +640,7 @@
// If B is a subtype match for Q with constraint set C. Note that we have
// already eliminated the case that X is a variable in L.
if (p is TypeParameterType) {
+ // Coverage-ignore-block(suite): Not run.
final int baseConstraintCount = _protoConstraints.length;
if (_isNullabilityAwareSubtypeMatch(p.bound, q,
constrainSupertype: constrainSupertype,
@@ -635,6 +649,7 @@
}
_protoConstraints.length = baseConstraintCount;
} else if (p is StructuralParameterType) {
+ // Coverage-ignore-block(suite): Not run.
final int baseConstraintCount = _protoConstraints.length;
if (_isNullabilityAwareSubtypeMatch(p.bound, q,
constrainSupertype: constrainSupertype,
@@ -730,6 +745,7 @@
treeNodeForTesting: treeNodeForTesting);
}
if (isMatch) return true;
+ // Coverage-ignore-block(suite): Not run.
_protoConstraints.length = baseConstraintCount;
}
@@ -741,6 +757,7 @@
//
// If P is a function type.
if (typeOperations.isDartCoreFunction(q) &&
+ // Coverage-ignore(suite): Not run.
typeOperations.isFunctionType(p)) {
return true;
}
@@ -775,6 +792,7 @@
}
if (isMatch) return true;
}
+ // Coverage-ignore-block(suite): Not run.
_protoConstraints.length = baseConstraintCount;
}
@@ -787,14 +805,20 @@
p.positionalParameters.length == p.requiredParameterCount &&
q.positionalParameters.length == q.requiredParameterCount &&
p.requiredParameterCount == q.requiredParameterCount &&
- (p.namedParameters.isNotEmpty || q.namedParameters.isNotEmpty)) {
+ (p.namedParameters.isNotEmpty ||
+ // Coverage-ignore(suite): Not run.
+ q.namedParameters.isNotEmpty)) {
final int baseConstraintCount = _protoConstraints.length;
if (_isNullabilityAwareSubtypeMatch(p.returnType, q.returnType,
constrainSupertype: constrainSupertype,
treeNodeForTesting: treeNodeForTesting)) {
bool isMatch = true;
- for (int i = 0; isMatch && i < p.positionalParameters.length; ++i) {
+ for (int i = 0;
+ isMatch && i < p.positionalParameters.length;
+ // Coverage-ignore(suite): Not run.
+ ++i) {
+ // Coverage-ignore-block(suite): Not run.
isMatch = isMatch &&
_isNullabilityAwareSubtypeMatch(
q.positionalParameters[i], p.positionalParameters[i],
@@ -816,6 +840,7 @@
}
if (isMatch) return true;
}
+ // Coverage-ignore-block(suite): Not run.
_protoConstraints.length = baseConstraintCount;
}
@@ -878,10 +903,13 @@
topType: typeOperations.objectQuestionType,
topFunctionType:
_environment.coreTypes.functionNonNullableRawType,
- unhandledTypeHandler: (DartType type, ignored) =>
- type is UnknownType
+ unhandledTypeHandler:
+ // Coverage-ignore(suite): Not run.
+ (DartType type, ignored) => type is UnknownType
? false
- : throw new UnsupportedError(
+ :
+ // Coverage-ignore(suite): Not run.
+ throw new UnsupportedError(
"Unsupported type '${type.runtimeType}'."));
for (GeneratedTypeConstraint constraint in constraints) {
if (constraint.isUpper) {
@@ -897,6 +925,7 @@
return true;
}
}
+ // Coverage-ignore-block(suite): Not run.
_protoConstraints.length = baseConstraintCount;
}
@@ -946,6 +975,7 @@
return false;
}
+ // Coverage-ignore(suite): Not run.
/// Attempts to match [subtype] as a subtype of [supertype], gathering any
/// constraints discovered in the process.
///
@@ -1165,11 +1195,13 @@
return false;
}
+ // Coverage-ignore(suite): Not run.
bool _isTop(DartType type) =>
type is DynamicType ||
type is VoidType ||
type == _environment.coreTypes.objectLegacyRawType;
+ // Coverage-ignore(suite): Not run.
/// Given two lists of function type formal parameters, checks that their
/// bounds are compatible.
///
diff --git a/pkg/front_end/lib/src/type_inference/type_demotion.dart b/pkg/front_end/lib/src/type_inference/type_demotion.dart
index 060d536..34027f6 100644
--- a/pkg/front_end/lib/src/type_inference/type_demotion.dart
+++ b/pkg/front_end/lib/src/type_inference/type_demotion.dart
@@ -16,6 +16,7 @@
const _HasPromotedTypeVariableVisitor();
@override
+ // Coverage-ignore(suite): Not run.
bool visitIntersectionType(IntersectionType node) => true;
}
diff --git a/pkg/front_end/lib/src/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/type_inference/type_inference_engine.dart
index a0e1174..900e5b8 100644
--- a/pkg/front_end/lib/src/type_inference/type_inference_engine.dart
+++ b/pkg/front_end/lib/src/type_inference/type_inference_engine.dart
@@ -116,6 +116,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitTypedefType(TypedefType node) {
return node.unalias.accept(this);
}
@@ -132,6 +133,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool visitIntersectionType(IntersectionType node) {
return node.left.accept(this);
}
@@ -352,6 +354,7 @@
SourceLibraryBuilder library, InferenceDataForTesting? dataForTesting) {
AssignedVariables<TreeNode, VariableDeclaration> assignedVariables;
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
assignedVariables = dataForTesting.flowAnalysisResult.assignedVariables =
new AssignedVariablesForTesting<TreeNode, VariableDeclaration>();
} else {
@@ -362,6 +365,7 @@
return new TypeInferrerImpl(this, uri, false, thisType, library,
assignedVariables, dataForTesting, unknownFunction);
}
+ // Coverage-ignore(suite): Not run.
return new TypeInferrerImplBenchmarked(this, uri, false, thisType, library,
assignedVariables, dataForTesting, benchmarker!, unknownFunction);
}
@@ -372,6 +376,7 @@
SourceLibraryBuilder library, InferenceDataForTesting? dataForTesting) {
AssignedVariables<TreeNode, VariableDeclaration> assignedVariables;
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
assignedVariables = dataForTesting.flowAnalysisResult.assignedVariables =
new AssignedVariablesForTesting<TreeNode, VariableDeclaration>();
} else {
@@ -382,6 +387,7 @@
return new TypeInferrerImpl(this, uri, true, thisType, library,
assignedVariables, dataForTesting, unknownFunction);
}
+ // Coverage-ignore(suite): Not run.
return new TypeInferrerImplBenchmarked(this, uri, true, thisType, library,
assignedVariables, dataForTesting, benchmarker!, unknownFunction);
}
@@ -457,6 +463,7 @@
typeEnvironment.coreTypes.boolRawType(Nullability.nonNullable);
@override
+ // Coverage-ignore(suite): Not run.
DartType get doubleType => throw new UnimplementedError('TODO(paulberry)');
@override
@@ -466,6 +473,7 @@
DartType get errorType => const InvalidType();
@override
+ // Coverage-ignore(suite): Not run.
DartType get intType => throw new UnimplementedError('TODO(paulberry)');
@override
@@ -515,11 +523,13 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool isExtensionType(DartType type) {
return type is ExtensionType;
}
@override
+ // Coverage-ignore(suite): Not run.
bool isInterfaceType(DartType type) {
return type is InterfaceType;
}
@@ -535,6 +545,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool isObject(DartType type) {
return type is InterfaceType &&
type.classNode == typeEnvironment.objectClass &&
@@ -688,6 +699,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool isTypeSchemaSatisfied(
{required DartType typeSchema, required DartType type}) =>
isSubtypeOf(type, typeSchema);
@@ -863,17 +875,20 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool typeSchemaIsSubtypeOfTypeSchema(
DartType leftSchema, DartType rightSchema) {
return isSubtypeOf(leftSchema, rightSchema);
}
@override
+ // Coverage-ignore(suite): Not run.
bool typeIsSubtypeOfTypeSchema(DartType leftType, DartType rightSchema) {
return isSubtypeOf(leftType, rightSchema);
}
@override
+ // Coverage-ignore(suite): Not run.
bool typeSchemaIsSubtypeOfType(DartType leftSchema, DartType rightType) {
return isSubtypeOf(leftSchema, rightType);
}
@@ -883,14 +898,17 @@
switch (modifier) {
case NullabilitySuffix.none:
return computeTypeWithoutNullabilityMarker(type);
+ // Coverage-ignore(suite): Not run.
case NullabilitySuffix.question:
return type.withDeclaredNullability(Nullability.nullable);
+ // Coverage-ignore(suite): Not run.
case NullabilitySuffix.star:
return type.withDeclaredNullability(Nullability.legacy);
}
}
@override
+ // Coverage-ignore(suite): Not run.
TypeDeclarationKind? getTypeDeclarationKind(DartType type) {
if (type is TypeDeclarationType) {
switch (type) {
@@ -905,6 +923,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
TypeDeclarationKind? getTypeSchemaDeclarationKind(DartType typeSchema) {
return getTypeDeclarationKind(typeSchema);
}
diff --git a/pkg/front_end/lib/src/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/type_inference/type_inferrer.dart
index 0e20fec..dfedd7b 100644
--- a/pkg/front_end/lib/src/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/type_inference/type_inferrer.dart
@@ -182,6 +182,7 @@
StatementInferenceResult result =
visitor.inferStatement(body, closureContext);
if (dataForTesting != null) {
+ // Coverage-ignore-block(suite): Not run.
if (!flowAnalysis.isReachable) {
dataForTesting!.flowAnalysisResult.functionBodiesThatDontComplete
.add(body);
@@ -216,6 +217,7 @@
List<NamedExpression> namedArguments = <NamedExpression>[];
for (VariableDeclaration parameter
in redirectingFactoryFunction.namedParameters) {
+ // Coverage-ignore-block(suite): Not run.
flowAnalysis.declare(parameter, parameter.type, initialized: true);
namedArguments.add(new NamedExpression(parameter.name!,
new VariableGetImpl(parameter, forNullGuardedAccess: false)));
@@ -284,6 +286,7 @@
}
}
+// Coverage-ignore(suite): Not run.
class TypeInferrerImplBenchmarked implements TypeInferrer {
final TypeInferrerImpl impl;
final Benchmarker benchmarker;
diff --git a/pkg/front_end/lib/src/type_inference/type_schema.dart b/pkg/front_end/lib/src/type_inference/type_schema.dart
index 793ff36..badca78 100644
--- a/pkg/front_end/lib/src/type_inference/type_schema.dart
+++ b/pkg/front_end/lib/src/type_inference/type_schema.dart
@@ -14,6 +14,7 @@
/// Determines whether a type schema contains `?` somewhere inside it.
bool isKnown(DartType schema) => !schema.accept(const _HasUnknownVisitor());
+// Coverage-ignore(suite): Not run.
/// Converts a [DartType] to a string, representing the unknown type as `?`.
String typeSchemaToString(DartType schema) {
StringBuffer buffer = new StringBuffer();
@@ -22,6 +23,7 @@
return '$buffer';
}
+// Coverage-ignore(suite): Not run.
/// Extension of [Printer] that represents the unknown type as `?`.
class TypeSchemaPrinter extends Printer {
TypeSchemaPrinter(StringSink sink,
@@ -54,6 +56,7 @@
Nullability get declaredNullability => Nullability.undetermined;
@override
+ // Coverage-ignore(suite): Not run.
Nullability get nullability => Nullability.undetermined;
@override
@@ -72,15 +75,18 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitChildren(Visitor<dynamic> v) {}
@override
UnknownType withDeclaredNullability(Nullability nullability) => this;
@override
+ // Coverage-ignore(suite): Not run.
UnknownType toNonNull() => this;
@override
+ // Coverage-ignore(suite): Not run.
void toTextInternal(AstPrinter printer) {
printer.write('?');
}
diff --git a/pkg/front_end/lib/src/type_inference/type_schema_elimination.dart b/pkg/front_end/lib/src/type_inference/type_schema_elimination.dart
index 65ac504..bb2da20 100644
--- a/pkg/front_end/lib/src/type_inference/type_schema_elimination.dart
+++ b/pkg/front_end/lib/src/type_inference/type_schema_elimination.dart
@@ -59,6 +59,7 @@
if (node is UnknownType) {
return isLeastClosure ? bottomType : topType;
}
+ // Coverage-ignore-block(suite): Not run.
throw new UnsupportedError(
"Unsupported auxiliary type $node (${node.runtimeType}).");
}
@@ -74,8 +75,9 @@
topType.classNode.enclosingLibrary.importUri.isScheme("dart") &&
topType.classNode.enclosingLibrary.importUri.path == "core" &&
topType.classNode.name == "Object");
- assert(
- bottomType == const NeverType.nonNullable() || bottomType is NullType);
+ assert(bottomType == const NeverType.nonNullable() ||
+ // Coverage-ignore(suite): Not run.
+ bottomType is NullType);
_TypeSchemaEliminationVisitor visitor =
new _TypeSchemaEliminationVisitor(topType, bottomType);
DartType? result = schema.accept1(
diff --git a/pkg/front_end/lib/src/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/type_inference/type_schema_environment.dart
index 5c10c74..b0c065b 100644
--- a/pkg/front_end/lib/src/type_inference/type_schema_environment.dart
+++ b/pkg/front_end/lib/src/type_inference/type_schema_environment.dart
@@ -277,6 +277,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
bool isTop(DartType t) {
if (t is UnknownType) {
return true;
@@ -336,6 +337,7 @@
MergedTypeConstraint constraint, DartType topType, DartType bottomType,
{bool grounded = false, bool isContravariant = false}) {
assert(bottomType == const NeverType.nonNullable() ||
+ // Coverage-ignore(suite): Not run.
bottomType == const NullType());
if (!isContravariant) {
// Prefer the known bound, if any.
@@ -358,6 +360,7 @@
} else {
// Prefer the known bound, if any.
if (isKnown(constraint.upper)) {
+ // Coverage-ignore-block(suite): Not run.
return constraint.upper;
}
if (isKnown(constraint.lower)) return constraint.lower;
@@ -365,19 +368,23 @@
// Otherwise take whatever bound has partial information,
// e.g. `Iterable<?>`
if (constraint.upper is! UnknownType) {
+ // Coverage-ignore-block(suite): Not run.
return grounded
? greatestClosure(constraint.upper, topType, bottomType)
: constraint.upper;
} else if (constraint.lower is! UnknownType) {
return grounded
? leastClosure(constraint.lower, topType, bottomType)
- : constraint.lower;
+ :
+ // Coverage-ignore(suite): Not run.
+ constraint.lower;
} else {
return const UnknownType();
}
}
}
+ // Coverage-ignore(suite): Not run.
/// Determine if the given [type] satisfies the given type [constraint].
bool typeSatisfiesConstraint(DartType type, MergedTypeConstraint constraint) {
return isSubtypeOf(
diff --git a/pkg/front_end/lib/src/util/error_reporter_file_copier.dart b/pkg/front_end/lib/src/util/error_reporter_file_copier.dart
index 4cddf72..395820b 100644
--- a/pkg/front_end/lib/src/util/error_reporter_file_copier.dart
+++ b/pkg/front_end/lib/src/util/error_reporter_file_copier.dart
@@ -4,6 +4,7 @@
import 'dart:io' show Directory, File, GZipCodec;
+// Coverage-ignore(suite): Not run.
Uri saveAsGzip(List<int> data, String filename) {
// TODO(jensj): This should be done via the FileSystem instead, but it
// currently doesn't support writing.
diff --git a/pkg/front_end/lib/src/util/experiment_environment_getter.dart b/pkg/front_end/lib/src/util/experiment_environment_getter.dart
index 0548ee8..c7cc4c4 100644
--- a/pkg/front_end/lib/src/util/experiment_environment_getter.dart
+++ b/pkg/front_end/lib/src/util/experiment_environment_getter.dart
@@ -16,6 +16,7 @@
Map<String, String> environment = Platform.environment;
for (String experiment in _known) {
if (environment[experiment] == "true") {
+ // Coverage-ignore-block(suite): Not run.
enabled.add(experiment);
}
}
diff --git a/pkg/front_end/lib/src/util/helpers.dart b/pkg/front_end/lib/src/util/helpers.dart
index 6ef01c8..b3eb4d5 100644
--- a/pkg/front_end/lib/src/util/helpers.dart
+++ b/pkg/front_end/lib/src/util/helpers.dart
@@ -15,10 +15,13 @@
bool isRecordAccessAllowed(SourceLibraryBuilder library) {
return library
.loader.target.context.options.globalFeatures.records.isEnabled ||
+ // Coverage-ignore(suite): Not run.
ExperimentalFlag.records.isEnabledByDefault ||
+ // Coverage-ignore(suite): Not run.
library.libraryFeatures.records.isEnabled;
}
+// Coverage-ignore(suite): Not run.
/// Returns `true` if [type] is `Record` from `dart:core`.
bool isDartCoreRecord(DartType type) {
Class? targetClass;
diff --git a/pkg/front_end/lib/src/util/parser_ast.dart b/pkg/front_end/lib/src/util/parser_ast.dart
index f210b61..62b1191 100644
--- a/pkg/front_end/lib/src/util/parser_ast.dart
+++ b/pkg/front_end/lib/src/util/parser_ast.dart
@@ -48,6 +48,7 @@
includeComments: includeComments,
configuration: scannerConfiguration,
languageVersionChanged: (scanner, languageVersion) {
+ // Coverage-ignore-block(suite): Not run.
// For now don't do anything, but having it (making it non-null) means the
// configuration won't be reset.
languageVersionsSeen?.add(languageVersion);
@@ -57,11 +58,13 @@
);
Token firstToken = scanner.tokenize();
if (lineStarts != null) {
+ // Coverage-ignore-block(suite): Not run.
lineStarts.addAll(scanner.lineStarts);
}
ParserASTListener listener = new ParserASTListener();
Parser parser;
if (includeBody) {
+ // Coverage-ignore-block(suite): Not run.
parser = new Parser(
listener,
useImplicitCreationExpression: useImplicitCreationExpressionInCfe,
@@ -97,26 +100,31 @@
}
@override
+ // Coverage-ignore(suite): Not run.
void visitTypeArgumentsEnd(TypeArgumentsEnd node) {
// Ignored
}
@override
+ // Coverage-ignore(suite): Not run.
void visitTypeListEnd(TypeListEnd node) {
// Ignored
}
@override
+ // Coverage-ignore(suite): Not run.
void visitFunctionTypeEnd(FunctionTypeEnd node) {
// Ignored
}
@override
+ // Coverage-ignore(suite): Not run.
void visitBlockEnd(BlockEnd node) {
// Ignored
}
}
+// Coverage-ignore(suite): Not run.
/// Best-effort visitor for ParserAstNode that visits top-level entries
/// and class members only (i.e. no bodies, no field initializer content, no
/// names etc).
@@ -500,6 +508,7 @@
FunctionBody,
}
+// Coverage-ignore(suite): Not run.
extension GeneralASTContentExtension on ParserAstNode {
// TODO(jensj): This might not actually be useful - we're doing a lot of if's
// here, but will then have to do more if's or a switch at the call site to
@@ -912,6 +921,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MetadataStarExtension on MetadataStarEnd {
List<MetadataEnd> getMetadataEntries() {
List<MetadataEnd> result = [];
@@ -923,6 +933,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MetadataExtension on MetadataEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -935,6 +946,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension CompilationUnitExtension on CompilationUnitEnd {
List<TopLevelDeclarationEnd> getClasses() {
List<TopLevelDeclarationEnd> result = [];
@@ -1022,6 +1034,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension TopLevelDeclarationExtension on TopLevelDeclarationEnd {
IdentifierHandle getIdentifier() {
for (ParserAstNode child in children!) {
@@ -1043,6 +1056,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MixinDeclarationExtension on MixinDeclarationEnd {
ClassOrMixinOrExtensionBodyEnd getClassOrMixinOrExtensionBody() {
for (ParserAstNode child in children!) {
@@ -1060,6 +1074,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension NamedMixinApplicationExtension on NamedMixinApplicationEnd {
IdentifierHandle getMixinIdentifier() {
ParserAstNode? parent = this.parent;
@@ -1068,6 +1083,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ClassDeclarationExtension on ClassDeclarationEnd {
ClassOrMixinOrExtensionBodyEnd getClassOrMixinOrExtensionBody() {
for (ParserAstNode child in children!) {
@@ -1110,6 +1126,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ClassOrMixinBodyExtension on ClassOrMixinOrExtensionBodyEnd {
List<MemberEnd> getMembers() {
List<MemberEnd> members = [];
@@ -1122,6 +1139,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MemberExtension on MemberEnd {
// TODO(jensj): This might not actually be useful - we're doing a lot of if's
// here, but will then have to do more if's or a switch at the call site to
@@ -1419,6 +1437,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MixinFieldsExtension on MixinFieldsEnd {
List<IdentifierHandle> getFieldIdentifiers() {
int countLeft = count;
@@ -1441,6 +1460,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionFieldsExtension on ExtensionFieldsEnd {
List<IdentifierHandle> getFieldIdentifiers() {
int countLeft = count;
@@ -1463,6 +1483,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionTypeFieldsExtension on ExtensionTypeFieldsEnd {
List<IdentifierHandle> getFieldIdentifiers() {
int countLeft = count;
@@ -1485,6 +1506,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension EnumFieldsExtension on EnumFieldsEnd {
List<IdentifierHandle> getFieldIdentifiers() {
int countLeft = count;
@@ -1507,6 +1529,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ClassFieldsExtension on ClassFieldsEnd {
List<IdentifierHandle> getFieldIdentifiers() {
int countLeft = count;
@@ -1543,6 +1566,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension EnumExtension on EnumEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> ids = [];
@@ -1569,6 +1593,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionDeclarationExtension on ExtensionDeclarationEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> ids = [];
@@ -1594,6 +1619,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionTypeDeclarationExtension on ExtensionTypeDeclarationEnd {
Token? getExtensionTypeName() {
ExtensionTypeDeclarationBegin begin =
@@ -1611,6 +1637,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension TopLevelMethodExtension on TopLevelMethodEnd {
IdentifierHandle getNameIdentifier() {
for (ParserAstNode child in children!) {
@@ -1628,6 +1655,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension TypedefExtension on TypedefEnd {
IdentifierHandle getNameIdentifier() {
for (ParserAstNode child in children!) {
@@ -1641,6 +1669,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ImportExtension on ImportEnd {
IdentifierHandle? getImportPrefix() {
for (ParserAstNode child in children!) {
@@ -1687,6 +1716,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExportExtension on ExportEnd {
String getExportUriString() {
StringBuffer sb = new StringBuffer();
@@ -1722,6 +1752,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension PartExtension on PartEnd {
String getPartUriString() {
StringBuffer sb = new StringBuffer();
@@ -1739,6 +1770,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension PartOfExtension on PartOfEnd {
String? getPartOfUriString() {
StringBuffer sb = new StringBuffer();
@@ -1766,6 +1798,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension LibraryNameExtension on LibraryNameEnd {
List<String> getNameIdentifiers() {
List<String> result = [];
@@ -1782,12 +1815,14 @@
const UnescapeErrorListenerDummy();
@override
+ // Coverage-ignore(suite): Not run.
void handleUnescapeError(
Message message, covariant location, int offset, int length) {
// Purposely doesn't do anything.
}
}
+// Coverage-ignore(suite): Not run.
extension TopLevelFieldsExtension on TopLevelFieldsEnd {
List<IdentifierHandle> getFieldIdentifiers() {
int countLeft = count;
@@ -1810,6 +1845,7 @@
}
}
+// Coverage-ignore(suite): Not run.
bool _isTypeOrNoType(ParserAstNode node) {
return node is TypeHandle ||
node is RecordTypeEnd ||
@@ -1818,6 +1854,7 @@
node is FunctionTypeEnd;
}
+// Coverage-ignore(suite): Not run.
extension ClassMethodExtension on ClassMethodEnd {
BlockFunctionBodyEnd? getBlockFunctionBody() {
for (ParserAstNode child in children!) {
@@ -1848,6 +1885,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MixinMethodExtension on MixinMethodEnd {
Token getNameIdentifierToken() {
bool foundType = false;
@@ -1869,6 +1907,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionMethodExtension on ExtensionMethodEnd {
Token getNameIdentifierToken() {
bool foundType = false;
@@ -1890,6 +1929,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionTypeMethodExtension on ExtensionTypeMethodEnd {
Token getNameIdentifierToken() {
bool foundType = false;
@@ -1911,6 +1951,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension EnumMethodExtension on EnumMethodEnd {
String getNameIdentifier() {
bool foundType = false;
@@ -1928,6 +1969,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ClassFactoryMethodExtension on ClassFactoryMethodEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -1942,6 +1984,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MixinFactoryMethodExtension on MixinFactoryMethodEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -1956,6 +1999,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionFactoryMethodExtension on ExtensionFactoryMethodEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -1970,6 +2014,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionTypeFactoryMethodExtension on ExtensionTypeFactoryMethodEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -1984,6 +2029,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension EnumFactoryMethodExtension on EnumFactoryMethodEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -1998,6 +2044,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ClassConstructorExtension on ClassConstructorEnd {
FormalParametersEnd getFormalParameters() {
for (ParserAstNode child in children!) {
@@ -2037,6 +2084,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionConstructorExtension on ExtensionConstructorEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -2049,6 +2097,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension ExtensionTypeConstructorExtension on ExtensionTypeConstructorEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -2061,6 +2110,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension EnumConstructorExtension on EnumConstructorEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -2073,6 +2123,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension MixinConstructorExtension on MixinConstructorEnd {
List<IdentifierHandle> getIdentifiers() {
List<IdentifierHandle> result = [];
@@ -2085,6 +2136,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension FormalParametersExtension on FormalParametersEnd {
List<FormalParameterEnd> getFormalParameters() {
List<FormalParameterEnd> result = [];
@@ -2106,12 +2158,14 @@
}
}
+// Coverage-ignore(suite): Not run.
extension FormalParameterExtension on FormalParameterEnd {
FormalParameterBegin getBegin() {
return children!.first as FormalParameterBegin;
}
}
+// Coverage-ignore(suite): Not run.
extension OptionalFormalParametersExtension on OptionalFormalParametersEnd {
List<FormalParameterEnd> getFormalParameters() {
List<FormalParameterEnd> result = [];
@@ -2124,6 +2178,7 @@
}
}
+// Coverage-ignore(suite): Not run.
extension InitializersExtension on InitializersEnd {
List<InitializerEnd> getInitializers() {
List<InitializerEnd> result = [];
@@ -2140,12 +2195,14 @@
}
}
+// Coverage-ignore(suite): Not run.
extension InitializerExtension on InitializerEnd {
InitializerBegin getBegin() {
return children!.first as InitializerBegin;
}
}
+// Coverage-ignore(suite): Not run.
void main(List<String> args) {
File f = new File(args[0]);
Uint8List data = f.readAsBytesSync();
@@ -2198,6 +2255,7 @@
}
}
if (beginIndex == null) {
+ // Coverage-ignore-block(suite): Not run.
throw "Couldn't find a begin for ${entry.what}. Has:\n"
"${data.map((e) => "${e.what}: ${e.type}").join("\n")}";
}
@@ -2237,7 +2295,9 @@
end == "EnumFields")) {
// beginFields is ended by one of endTopLevelFields, endMixinFields,
// endEnumFields or endExtensionFields.
- } else if (begin == "ForStatement" && end == "ForIn") {
+ } else if (begin == "ForStatement" &&
+ // Coverage-ignore(suite): Not run.
+ end == "ForIn") {
// beginForStatement is ended by either endForStatement or endForIn.
} else if (begin == "FactoryMethod" &&
(end == "ClassFactoryMethod" ||
@@ -2248,7 +2308,9 @@
// beginFactoryMethod is ended by either endClassFactoryMethod,
// endMixinFactoryMethod, endExtensionFactoryMethod, or
// endEnumFactoryMethod.
- } else if (begin == "ForControlFlow" && (end == "ForInControlFlow")) {
+ }
+ // Coverage-ignore(suite): Not run.
+ else if (begin == "ForControlFlow" && (end == "ForInControlFlow")) {
// beginForControlFlow is ended by either endForControlFlow or
// endForInControlFlow.
} else if (begin == "IfControlFlow" && (end == "IfElseControlFlow")) {
@@ -2285,6 +2347,7 @@
}
@override
+ // Coverage-ignore(suite): Not run.
Uri get uri => throw new UnimplementedError();
@override
diff --git a/pkg/front_end/lib/src/util/textual_outline.dart b/pkg/front_end/lib/src/util/textual_outline.dart
index 71a615f..f183c42 100644
--- a/pkg/front_end/lib/src/util/textual_outline.dart
+++ b/pkg/front_end/lib/src/util/textual_outline.dart
@@ -144,6 +144,7 @@
@override
int compareTo(_Chunk o) {
if (o is! _SortableChunk) {
+ // Coverage-ignore-block(suite): Not run.
return super.compareTo(o);
}
@@ -391,10 +392,12 @@
}
}
+// Coverage-ignore(suite): Not run.
class _ScriptTagChunk extends _TokenChunk {
_ScriptTagChunk(Token token) : super(token, token);
}
+// Coverage-ignore(suite): Not run.
class _UnknownChunk extends _TokenChunk {
_UnknownChunk(Token startToken, Token endToken) : super(startToken, endToken);
}
@@ -445,6 +448,7 @@
parsedChunks.add(new _LanguageVersionChunk(
languageVersionToken.major, languageVersionToken.minor)
..originalPosition = originalPosition.value++);
+ // Coverage-ignore-block(suite): Not run.
infoForTesting?.languageVersionTokens.add(languageVersionToken);
});
Token firstToken = scanner.tokenize();
@@ -452,6 +456,7 @@
ClassMemberParser classMemberParser =
new ClassMemberParser(listener, allowPatterns: enablePatterns);
classMemberParser.parseUnit(firstToken);
+ // Coverage-ignore(suite): Not run.
infoForTesting?.hasParserErrors = listener.gotError;
if (listener.gotError && returnNullOnError) {
return null;
@@ -517,6 +522,7 @@
}
}
if (metadataChunks != null) {
+ // Coverage-ignore-block(suite): Not run.
for (_MetadataChunk metadata in metadataChunks) {
result.add(metadata);
}
@@ -589,6 +595,7 @@
return metadataChunk.endToken.next;
}
+ // Coverage-ignore-block(suite): Not run.
// This token --- and whatever else tokens until we reach a start token we
// know is an unknown chunk. We don't yet know the end.
if (currentUnknown.start == null) {
@@ -645,6 +652,7 @@
BoxedInt originalPosition,
TextualOutlineInfoForTesting? infoForTesting) {
if (_currentUnknown.start == null) return;
+ // Coverage-ignore-block(suite): Not run.
infoForTesting?.hasUnknownChunk = true;
parsedChunks.add(
new _UnknownChunk(_currentUnknown.start!, _currentUnknown.interimEnd!)
@@ -653,6 +661,7 @@
_currentUnknown.interimEnd = null;
}
+// Coverage-ignore(suite): Not run.
void main(List<String> args) {
File f = new File(args[0]);
Uint8List data = f.readAsBytesSync();
@@ -700,6 +709,7 @@
final Map<Token, _TokenChunk> unsortableElementStartToChunk = {};
@override
+ // Coverage-ignore(suite): Not run.
void handleScript(Token token) {
unsortableElementStartToChunk[token] = new _ScriptTagChunk(token);
}
@@ -900,6 +910,7 @@
if (message.code == codeNativeClauseShouldBeAnnotation) {
return;
}
+ // Coverage-ignore-block(suite): Not run.
gotError = true;
}
}
diff --git a/pkg/front_end/test/coverage_suite_expected.dart b/pkg/front_end/test/coverage_suite_expected.dart
index 78466ff..27fb782 100644
--- a/pkg/front_end/test/coverage_suite_expected.dart
+++ b/pkg/front_end/test/coverage_suite_expected.dart
@@ -8,120 +8,120 @@
// using out/ReleaseX64/dart-sdk/bin/dart (which for instance makes a
// difference for compute_platform_binaries_location.dart).
const Map<String, ({int hitCount, int missCount})> _expect = {
- // 18.614718614718615%.
+ // 100.0%.
"package:front_end/src/api_prototype/compiler_options.dart": (
hitCount: 43,
- missCount: 188,
+ missCount: 0,
),
- // 89.1891891891892%.
+ // 100.0%.
"package:front_end/src/api_prototype/experimental_flags.dart": (
hitCount: 66,
- missCount: 8,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/api_prototype/file_system.dart": (
hitCount: 2,
missCount: 0,
),
- // 6.666666666666667%.
+ // 100.0%.
"package:front_end/src/api_prototype/incremental_kernel_generator.dart": (
hitCount: 1,
- missCount: 14,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/api_prototype/kernel_generator.dart": (
hitCount: 0,
- missCount: 18,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/api_prototype/language_version.dart": (
hitCount: 0,
- missCount: 65,
+ missCount: 0,
),
- // 3.927492447129909%.
+ // 100.0%.
"package:front_end/src/api_prototype/lowering_predicates.dart": (
hitCount: 13,
- missCount: 318,
+ missCount: 0,
),
- // 27.710843373493976%.
+ // 100.0%.
"package:front_end/src/api_prototype/memory_file_system.dart": (
hitCount: 23,
- missCount: 60,
+ missCount: 0,
),
- // 38.83495145631068%.
+ // 100.0%.
"package:front_end/src/api_prototype/standard_file_system.dart": (
hitCount: 40,
- missCount: 63,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/api_prototype/summary_generator.dart": (
hitCount: 0,
- missCount: 4,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/api_prototype/terminal_color_support.dart": (
hitCount: 0,
- missCount: 6,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/api_unstable/compiler_state.dart": (
hitCount: 0,
- missCount: 12,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/api_unstable/dart2js.dart": (
hitCount: 0,
- missCount: 74,
+ missCount: 0,
),
- // 37.03703703703704%.
+ // 100.0%.
"package:front_end/src/api_unstable/util.dart": (
hitCount: 10,
- missCount: 17,
+ missCount: 0,
),
- // 94.44444444444444%.
+ // 100.0%.
"package:front_end/src/base/builder_graph.dart": (
hitCount: 17,
- missCount: 1,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/base/combinator.dart": (
hitCount: 9,
missCount: 0,
),
- // 70.70707070707071%.
+ // 100.0%.
"package:front_end/src/base/command_line_reporting.dart": (
hitCount: 70,
- missCount: 29,
+ missCount: 0,
),
- // 93.22033898305084%.
+ // 100.0%.
"package:front_end/src/base/compiler_context.dart": (
hitCount: 55,
- missCount: 4,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/base/configuration.dart": (
hitCount: 1,
missCount: 0,
),
- // 59.09090909090909%.
+ // 100.0%.
"package:front_end/src/base/crash.dart": (
hitCount: 52,
- missCount: 36,
+ missCount: 0,
),
- // 88.88888888888889%.
+ // 100.0%.
"package:front_end/src/base/export.dart": (
hitCount: 16,
- missCount: 2,
+ missCount: 0,
),
- // 50.0%.
+ // 100.0%.
"package:front_end/src/base/hybrid_file_system.dart": (
hitCount: 21,
- missCount: 21,
+ missCount: 0,
),
- // 84.78260869565217%.
+ // 100.0%.
"package:front_end/src/base/identifiers.dart": (
hitCount: 78,
- missCount: 14,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/base/ignored_parser_errors.dart": (
@@ -133,30 +133,30 @@
hitCount: 48,
missCount: 0,
),
- // 96.96969696969697%.
+ // 100.0%.
"package:front_end/src/base/import_chains.dart": (
hitCount: 96,
- missCount: 3,
+ missCount: 0,
),
- // 50.795521508544496%.
+ // 100.0%.
"package:front_end/src/base/incremental_compiler.dart": (
hitCount: 862,
- missCount: 835,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/base/incremental_serializer.dart": (
hitCount: 0,
- missCount: 202,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/base/instrumentation.dart": (
hitCount: 29,
missCount: 0,
),
- // 86.20689655172413%.
+ // 100.0%.
"package:front_end/src/base/library_graph.dart": (
hitCount: 25,
- missCount: 4,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/base/messages.dart": (
@@ -173,65 +173,65 @@
hitCount: 4,
missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/base/problems.dart": (
hitCount: 0,
- missCount: 29,
+ missCount: 0,
),
- // 40.75993091537133%.
+ // 100.0%.
"package:front_end/src/base/processed_options.dart": (
hitCount: 236,
- missCount: 343,
+ missCount: 0,
),
- // 84.01682439537329%.
+ // 100.0%.
"package:front_end/src/base/scope.dart": (
hitCount: 799,
- missCount: 152,
+ missCount: 0,
),
- // 73.07692307692307%.
+ // 100.0%.
"package:front_end/src/base/ticker.dart": (
hitCount: 19,
- missCount: 7,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/base/uri_offset.dart": (
hitCount: 1,
missCount: 0,
),
- // 75.92592592592592%.
+ // 100.0%.
"package:front_end/src/base/uri_translator.dart": (
hitCount: 41,
- missCount: 13,
+ missCount: 0,
),
- // 69.23076923076923%.
+ // 100.0%.
"package:front_end/src/base/uris.dart": (
hitCount: 9,
- missCount: 4,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/builder/augmentation_iterator.dart": (
hitCount: 0,
- missCount: 17,
+ missCount: 0,
),
- // 72.5%.
+ // 100.0%.
"package:front_end/src/builder/builder.dart": (
hitCount: 29,
- missCount: 11,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/builder/builder_mixins.dart": (
hitCount: 42,
missCount: 0,
),
- // 70.0%.
+ // 100.0%.
"package:front_end/src/builder/builtin_type_declaration_builder.dart": (
hitCount: 7,
- missCount: 3,
+ missCount: 0,
),
- // 71.64179104477611%.
+ // 100.0%.
"package:front_end/src/builder/class_builder.dart": (
hitCount: 144,
- missCount: 57,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/builder/constructor_reference_builder.dart": (
@@ -258,700 +258,700 @@
hitCount: 17,
missCount: 0,
),
- // 22.727272727272727%.
+ // 100.0%.
"package:front_end/src/builder/fixed_type_builder.dart": (
hitCount: 5,
- missCount: 17,
+ missCount: 0,
),
- // 95.87628865979381%.
+ // 100.0%.
"package:front_end/src/builder/formal_parameter_builder.dart": (
hitCount: 186,
- missCount: 8,
+ missCount: 0,
),
- // 77.95275590551181%.
+ // 100.0%.
"package:front_end/src/builder/function_type_builder.dart": (
hitCount: 99,
- missCount: 28,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/builder/future_or_type_declaration_builder.dart": (
hitCount: 0,
- missCount: 10,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/builder/inferable_type_builder.dart": (
hitCount: 27,
missCount: 0,
),
- // 33.33333333333333%.
+ // 100.0%.
"package:front_end/src/builder/invalid_type_builder.dart": (
hitCount: 4,
- missCount: 8,
+ missCount: 0,
),
- // 85.0%.
+ // 100.0%.
"package:front_end/src/builder/invalid_type_declaration_builder.dart": (
hitCount: 17,
- missCount: 3,
+ missCount: 0,
),
- // 78.48101265822784%.
+ // 100.0%.
"package:front_end/src/builder/library_builder.dart": (
hitCount: 62,
- missCount: 17,
+ missCount: 0,
),
- // 97.38562091503267%.
+ // 100.0%.
"package:front_end/src/builder/member_builder.dart": (
hitCount: 149,
- missCount: 4,
+ missCount: 0,
),
- // 86.04651162790698%.
+ // 100.0%.
"package:front_end/src/builder/metadata_builder.dart": (
hitCount: 37,
- missCount: 6,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/builder/mixin_application_builder.dart": (
hitCount: 1,
missCount: 0,
),
- // 85.0%.
+ // 100.0%.
"package:front_end/src/builder/modifier_builder.dart": (
hitCount: 17,
- missCount: 3,
+ missCount: 0,
),
- // 80.60606060606061%.
+ // 100.0%.
"package:front_end/src/builder/named_type_builder.dart": (
hitCount: 399,
- missCount: 96,
+ missCount: 0,
),
- // 76.92307692307693%.
+ // 100.0%.
"package:front_end/src/builder/never_type_declaration_builder.dart": (
hitCount: 10,
- missCount: 3,
+ missCount: 0,
),
- // 33.33333333333333%.
+ // 100.0%.
"package:front_end/src/builder/null_type_declaration_builder.dart": (
hitCount: 2,
- missCount: 4,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/builder/nullability_builder.dart": (
hitCount: 24,
missCount: 0,
),
- // 37.83783783783784%.
+ // 100.0%.
"package:front_end/src/builder/omitted_type_builder.dart": (
hitCount: 28,
- missCount: 46,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/builder/omitted_type_declaration_builder.dart": (
hitCount: 0,
- missCount: 5,
+ missCount: 0,
),
- // 89.74358974358975%.
+ // 100.0%.
"package:front_end/src/builder/prefix_builder.dart": (
hitCount: 35,
- missCount: 4,
+ missCount: 0,
),
- // 77.77777777777779%.
+ // 100.0%.
"package:front_end/src/builder/record_type_builder.dart": (
hitCount: 154,
- missCount: 44,
+ missCount: 0,
),
- // 78.8135593220339%.
+ // 100.0%.
"package:front_end/src/builder/type_alias_builder.dart": (
hitCount: 186,
- missCount: 50,
+ missCount: 0,
),
- // 82.35294117647058%.
+ // 100.0%.
"package:front_end/src/builder/type_builder.dart": (
hitCount: 56,
- missCount: 12,
+ missCount: 0,
),
- // 90.0%.
+ // 100.0%.
"package:front_end/src/builder/type_declaration_builder.dart": (
hitCount: 9,
- missCount: 1,
+ missCount: 0,
),
- // 78.32167832167832%.
+ // 100.0%.
"package:front_end/src/builder/type_variable_builder.dart": (
hitCount: 336,
- missCount: 93,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/builder/void_type_declaration_builder.dart": (
hitCount: 2,
missCount: 0,
),
- // 85.0574712643678%.
+ // 100.0%.
"package:front_end/src/codes/type_labeler.dart": (
hitCount: 518,
- missCount: 91,
+ missCount: 0,
),
- // 71.23287671232876%.
+ // 100.0%.
"package:front_end/src/compute_platform_binaries_location.dart": (
hitCount: 52,
- missCount: 21,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/dill/dill_builder_mixins.dart": (
hitCount: 16,
missCount: 0,
),
- // 93.37016574585635%.
+ // 100.0%.
"package:front_end/src/dill/dill_class_builder.dart": (
hitCount: 169,
- missCount: 12,
+ missCount: 0,
),
- // 86.74698795180723%.
+ // 100.0%.
"package:front_end/src/dill/dill_extension_builder.dart": (
hitCount: 72,
- missCount: 11,
+ missCount: 0,
),
- // 70.29702970297029%.
+ // 100.0%.
"package:front_end/src/dill/dill_extension_member_builder.dart": (
hitCount: 71,
- missCount: 30,
+ missCount: 0,
),
- // 95.42483660130719%.
+ // 100.0%.
"package:front_end/src/dill/dill_extension_type_declaration_builder.dart": (
hitCount: 146,
- missCount: 7,
+ missCount: 0,
),
- // 83.76623376623377%.
+ // 100.0%.
"package:front_end/src/dill/dill_extension_type_member_builder.dart": (
hitCount: 129,
- missCount: 25,
+ missCount: 0,
),
- // 85.05154639175258%.
+ // 100.0%.
"package:front_end/src/dill/dill_library_builder.dart": (
hitCount: 330,
- missCount: 58,
+ missCount: 0,
),
- // 77.03349282296651%.
+ // 100.0%.
"package:front_end/src/dill/dill_loader.dart": (
hitCount: 161,
- missCount: 48,
+ missCount: 0,
),
- // 86.52173913043478%.
+ // 100.0%.
"package:front_end/src/dill/dill_member_builder.dart": (
hitCount: 199,
- missCount: 31,
+ missCount: 0,
),
- // 74.35897435897436%.
+ // 100.0%.
"package:front_end/src/dill/dill_target.dart": (
hitCount: 29,
- missCount: 10,
+ missCount: 0,
),
- // 95.83333333333334%.
+ // 100.0%.
"package:front_end/src/dill/dill_type_alias_builder.dart": (
hitCount: 46,
- missCount: 2,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/kernel/augmentation_lowering.dart": (
hitCount: 4,
missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/kernel/benchmarker.dart": (
hitCount: 0,
- missCount: 128,
+ missCount: 0,
),
- // 92.06539074960128%.
+ // 100.0%.
"package:front_end/src/kernel/body_builder.dart": (
hitCount: 6927,
- missCount: 597,
+ missCount: 0,
),
- // 91.26984126984127%.
+ // 100.0%.
"package:front_end/src/kernel/body_builder_context.dart": (
hitCount: 345,
- missCount: 33,
+ missCount: 0,
),
- // 36.83510638297872%.
+ // 100.0%.
"package:front_end/src/kernel/collections.dart": (
hitCount: 277,
- missCount: 475,
+ missCount: 0,
),
- // 92.54807692307693%.
+ // 100.0%.
"package:front_end/src/kernel/combined_member_signature.dart": (
hitCount: 385,
- missCount: 31,
+ missCount: 0,
),
- // 60.89743589743589%.
+ // 100.0%.
"package:front_end/src/kernel/const_conditional_simplifier.dart": (
hitCount: 95,
- missCount: 61,
+ missCount: 0,
),
- // 69.72789115646259%.
+ // 100.0%.
"package:front_end/src/kernel/constant_collection_builders.dart": (
hitCount: 205,
- missCount: 89,
+ missCount: 0,
),
- // 85.16024152345565%.
+ // 100.0%.
"package:front_end/src/kernel/constant_evaluator.dart": (
- hitCount: 3667,
- missCount: 639,
+ hitCount: 3697,
+ missCount: 0,
),
- // 97.59036144578313%.
+ // 100.0%.
"package:front_end/src/kernel/constant_int_folder.dart": (
hitCount: 243,
- missCount: 6,
+ missCount: 0,
),
- // 95.11278195488721%.
+ // 100.0%.
"package:front_end/src/kernel/constructor_tearoff_lowering.dart": (
hitCount: 253,
- missCount: 13,
+ missCount: 0,
),
- // 75.0392464678179%.
+ // 100.0%.
"package:front_end/src/kernel/exhaustiveness.dart": (
hitCount: 478,
- missCount: 159,
+ missCount: 0,
),
- // 79.81651376146789%.
+ // 100.0%.
"package:front_end/src/kernel/expression_generator.dart": (
hitCount: 2523,
- missCount: 638,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/kernel/expression_generator_helper.dart": (
hitCount: 36,
missCount: 0,
),
- // 93.97590361445783%.
+ // 100.0%.
"package:front_end/src/kernel/forest.dart": (
hitCount: 390,
- missCount: 25,
+ missCount: 0,
),
- // 94.4927536231884%.
+ // 100.0%.
"package:front_end/src/kernel/forwarding_node.dart": (
hitCount: 326,
- missCount: 19,
+ missCount: 0,
),
- // 83.1896551724138%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/class_member.dart": (
hitCount: 386,
- missCount: 78,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/kernel/hierarchy/delayed.dart": (
hitCount: 218,
missCount: 0,
),
- // 87.92710706150342%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/extension_type_members.dart": (
hitCount: 386,
- missCount: 53,
+ missCount: 0,
),
- // 50.77720207253886%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/hierarchy_builder.dart": (
hitCount: 98,
- missCount: 95,
+ missCount: 0,
),
- // 93.33333333333333%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/hierarchy_node.dart": (
hitCount: 392,
- missCount: 28,
+ missCount: 0,
),
- // 98.51851851851852%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/members_builder.dart": (
hitCount: 133,
- missCount: 2,
+ missCount: 0,
),
- // 91.52276295133439%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/members_node.dart": (
hitCount: 1166,
- missCount: 108,
+ missCount: 0,
),
- // 61.53846153846154%.
+ // 100.0%.
"package:front_end/src/kernel/hierarchy/mixin_inferrer.dart": (
hitCount: 248,
- missCount: 155,
+ missCount: 0,
),
- // 60.3896103896104%.
+ // 100.0%.
"package:front_end/src/kernel/implicit_field_type.dart": (
hitCount: 93,
- missCount: 61,
+ missCount: 0,
),
- // 5.555555555555555%.
+ // 100.0%.
"package:front_end/src/kernel/implicit_type_argument.dart": (
hitCount: 1,
- missCount: 17,
+ missCount: 0,
),
- // 47.25972994440032%.
+ // 100.0%.
"package:front_end/src/kernel/internal_ast.dart": (
hitCount: 595,
- missCount: 664,
+ missCount: 0,
),
- // 78.18181818181819%.
+ // 100.0%.
"package:front_end/src/kernel/invalid_type.dart": (
hitCount: 43,
- missCount: 12,
+ missCount: 0,
),
- // 55.55555555555556%.
+ // 100.0%.
"package:front_end/src/kernel/kernel_constants.dart": (
hitCount: 10,
- missCount: 8,
+ missCount: 0,
),
- // 98.95833333333334%.
+ // 100.0%.
"package:front_end/src/kernel/kernel_helper.dart": (
hitCount: 285,
- missCount: 3,
+ missCount: 0,
),
- // 81.35072908672295%.
+ // 100.0%.
"package:front_end/src/kernel/kernel_target.dart": (
hitCount: 1060,
- missCount: 243,
+ missCount: 0,
),
- // 61.111111111111114%.
+ // 100.0%.
"package:front_end/src/kernel/kernel_variable_builder.dart": (
hitCount: 11,
- missCount: 7,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/kernel/late_lowering.dart": (
hitCount: 368,
missCount: 0,
),
- // 89.58333333333334%.
+ // 100.0%.
"package:front_end/src/kernel/load_library_builder.dart": (
hitCount: 43,
- missCount: 5,
+ missCount: 0,
),
- // 0.19801980198019803%.
+ // 100.0%.
"package:front_end/src/kernel/macro/annotation_parser.dart": (
hitCount: 2,
- missCount: 1008,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/kernel/macro/identifiers.dart": (
hitCount: 0,
- missCount: 120,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/kernel/macro/introspectors.dart": (
hitCount: 0,
- missCount: 549,
+ missCount: 0,
),
- // 0.1932367149758454%.
+ // 100.0%.
"package:front_end/src/kernel/macro/macro.dart": (
hitCount: 2,
- missCount: 1033,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/kernel/macro/offsets.dart": (
hitCount: 0,
- missCount: 201,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/kernel/macro/types.dart": (
hitCount: 0,
- missCount: 230,
+ missCount: 0,
),
- // 91.13475177304964%.
+ // 100.0%.
"package:front_end/src/kernel/member_covariance.dart": (
hitCount: 257,
- missCount: 25,
+ missCount: 0,
),
- // 39.473684210526315%.
+ // 100.0%.
"package:front_end/src/kernel/resource_identifier.dart": (
hitCount: 15,
- missCount: 23,
+ missCount: 0,
),
- // 15.238095238095239%.
+ // 100.0%.
"package:front_end/src/kernel/static_weak_references.dart": (
hitCount: 16,
- missCount: 89,
+ missCount: 0,
),
- // 20.77922077922078%.
+ // 100.0%.
"package:front_end/src/kernel/try_constant_evaluator.dart": (
hitCount: 16,
- missCount: 61,
+ missCount: 0,
),
- // 94.27402862985686%.
+ // 100.0%.
"package:front_end/src/kernel/type_algorithms.dart": (
hitCount: 922,
- missCount: 56,
+ missCount: 0,
),
- // 92.10526315789474%.
+ // 100.0%.
"package:front_end/src/kernel/type_builder_computer.dart": (
hitCount: 175,
- missCount: 15,
+ missCount: 0,
),
- // 37.93103448275862%.
+ // 100.0%.
"package:front_end/src/kernel/utils.dart": (
hitCount: 66,
- missCount: 108,
+ missCount: 0,
),
- // 56.25%.
+ // 100.0%.
"package:front_end/src/kernel/verifier.dart": (
hitCount: 18,
- missCount: 14,
+ missCount: 0,
),
- // 28.947368421052634%.
+ // 100.0%.
"package:front_end/src/kernel_generator_impl.dart": (
hitCount: 55,
- missCount: 135,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/macros/isolate_macro_serializer.dart": (
hitCount: 0,
- missCount: 15,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/macros/macro_serializer.dart": (
hitCount: 0,
- missCount: 4,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/macros/macro_target.dart": (
hitCount: 0,
- missCount: 3,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/macros/macro_target_io.dart": (
hitCount: 0,
- missCount: 42,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/macros/temp_dir_macro_serializer.dart": (
hitCount: 0,
- missCount: 18,
+ missCount: 0,
),
- // 80.29556650246306%.
+ // 100.0%.
"package:front_end/src/source/class_declaration.dart": (
hitCount: 163,
- missCount: 40,
+ missCount: 0,
),
- // 93.38129496402877%.
+ // 100.0%.
"package:front_end/src/source/diet_listener.dart": (
hitCount: 649,
- missCount: 46,
+ missCount: 0,
),
// 100.0%.
"package:front_end/src/source/diet_parser.dart": (
hitCount: 4,
missCount: 0,
),
- // 93.99141630901288%.
+ // 100.0%.
"package:front_end/src/source/name_scheme.dart": (
hitCount: 219,
- missCount: 14,
+ missCount: 0,
),
- // 95.16129032258065%.
+ // 100.0%.
"package:front_end/src/source/offset_map.dart": (
hitCount: 118,
- missCount: 6,
+ missCount: 0,
),
- // 93.60228198859005%.
+ // 100.0%.
"package:front_end/src/source/outline_builder.dart": (
hitCount: 2297,
- missCount: 157,
+ missCount: 0,
),
- // 94.44444444444444%.
+ // 100.0%.
"package:front_end/src/source/redirecting_factory_body.dart": (
hitCount: 34,
- missCount: 2,
+ missCount: 0,
),
- // 88.8268156424581%.
+ // 100.0%.
"package:front_end/src/source/source_builder_mixins.dart": (
hitCount: 159,
- missCount: 20,
+ missCount: 0,
),
- // 86.01845280340667%.
+ // 100.0%.
"package:front_end/src/source/source_class_builder.dart": (
hitCount: 1212,
- missCount: 197,
+ missCount: 0,
),
- // 93.058568329718%.
+ // 100.0%.
"package:front_end/src/source/source_constructor_builder.dart": (
hitCount: 858,
- missCount: 64,
+ missCount: 0,
),
- // 95.73560767590618%.
+ // 100.0%.
"package:front_end/src/source/source_enum_builder.dart": (
hitCount: 449,
- missCount: 20,
+ missCount: 0,
),
- // 64.15094339622641%.
+ // 100.0%.
"package:front_end/src/source/source_extension_builder.dart": (
hitCount: 68,
- missCount: 38,
+ missCount: 0,
),
- // 84.29423459244532%.
+ // 100.0%.
"package:front_end/src/source/source_extension_type_declaration_builder.dart":
(
hitCount: 424,
- missCount: 79,
+ missCount: 0,
),
- // 92.22222222222223%.
+ // 100.0%.
"package:front_end/src/source/source_factory_builder.dart": (
hitCount: 581,
- missCount: 49,
+ missCount: 0,
),
- // 94.2537909018356%.
+ // 100.0%.
"package:front_end/src/source/source_field_builder.dart": (
hitCount: 1181,
- missCount: 72,
+ missCount: 0,
),
- // 89.39393939393939%.
+ // 100.0%.
"package:front_end/src/source/source_function_builder.dart": (
hitCount: 295,
- missCount: 35,
+ missCount: 0,
),
- // 85.15720204728248%.
+ // 100.0%.
"package:front_end/src/source/source_library_builder.dart": (
- hitCount: 3494,
- missCount: 609,
+ hitCount: 3510,
+ missCount: 0,
),
- // 81.82628062360801%.
+ // 100.0%.
"package:front_end/src/source/source_loader.dart": (
- hitCount: 1837,
- missCount: 408,
+ hitCount: 1836,
+ missCount: 0,
),
- // 50.0%.
+ // 100.0%.
"package:front_end/src/source/source_member_builder.dart": (
hitCount: 25,
- missCount: 25,
+ missCount: 0,
),
- // 96.11829944547135%.
+ // 100.0%.
"package:front_end/src/source/source_procedure_builder.dart": (
hitCount: 520,
- missCount: 21,
+ missCount: 0,
),
- // 97.63313609467455%.
+ // 100.0%.
"package:front_end/src/source/source_type_alias_builder.dart": (
hitCount: 330,
- missCount: 8,
+ missCount: 0,
),
- // 83.33333333333334%.
+ // 100.0%.
"package:front_end/src/source/stack_listener_impl.dart": (
hitCount: 20,
- missCount: 4,
+ missCount: 0,
),
- // 86.70886075949366%.
+ // 100.0%.
"package:front_end/src/type_inference/closure_context.dart": (
hitCount: 411,
- missCount: 63,
+ missCount: 0,
),
- // 77.55474452554745%.
+ // 100.0%.
"package:front_end/src/type_inference/delayed_expressions.dart": (
hitCount: 425,
- missCount: 123,
+ missCount: 0,
),
- // 97.88732394366197%.
+ // 100.0%.
"package:front_end/src/type_inference/external_ast_helper.dart": (
hitCount: 139,
- missCount: 3,
+ missCount: 0,
),
- // 76.19047619047619%.
+ // 100.0%.
"package:front_end/src/type_inference/factor_type.dart": (
hitCount: 16,
- missCount: 5,
+ missCount: 0,
),
- // 75.47169811320755%.
+ // 100.0%.
"package:front_end/src/type_inference/for_in.dart": (
hitCount: 120,
- missCount: 39,
+ missCount: 0,
),
- // 87.36842105263159%.
+ // 100.0%.
"package:front_end/src/type_inference/inference_results.dart": (
hitCount: 166,
- missCount: 24,
+ missCount: 0,
),
- // 90.44083526682135%.
+ // 100.0%.
"package:front_end/src/type_inference/inference_visitor.dart": (
hitCount: 7796,
- missCount: 824,
+ missCount: 0,
),
- // 85.96491228070175%.
+ // 100.0%.
"package:front_end/src/type_inference/inference_visitor_base.dart": (
hitCount: 2401,
- missCount: 392,
+ missCount: 0,
),
- // 80.26509572901325%.
+ // 100.0%.
"package:front_end/src/type_inference/matching_cache.dart": (
hitCount: 545,
- missCount: 134,
+ missCount: 0,
),
- // 98.10964083175804%.
+ // 100.0%.
"package:front_end/src/type_inference/matching_expressions.dart": (
hitCount: 519,
- missCount: 10,
+ missCount: 0,
),
- // 81.13522537562604%.
+ // 100.0%.
"package:front_end/src/type_inference/object_access_target.dart": (
hitCount: 486,
- missCount: 113,
+ missCount: 0,
),
- // 98.0%.
+ // 100.0%.
"package:front_end/src/type_inference/shared_type_analyzer.dart": (
hitCount: 98,
- missCount: 2,
+ missCount: 0,
),
- // 71.42857142857143%.
+ // 100.0%.
"package:front_end/src/type_inference/standard_bounds.dart": (
hitCount: 20,
- missCount: 8,
+ missCount: 0,
),
- // 61.28608923884514%.
+ // 100.0%.
"package:front_end/src/type_inference/type_constraint_gatherer.dart": (
hitCount: 467,
- missCount: 295,
+ missCount: 0,
),
- // 95.0%.
+ // 100.0%.
"package:front_end/src/type_inference/type_demotion.dart": (
hitCount: 19,
- missCount: 1,
+ missCount: 0,
),
- // 90.29850746268657%.
+ // 100.0%.
"package:front_end/src/type_inference/type_inference_engine.dart": (
hitCount: 484,
- missCount: 52,
+ missCount: 0,
),
- // 54.037267080745345%.
+ // 100.0%.
"package:front_end/src/type_inference/type_inferrer.dart": (
hitCount: 87,
- missCount: 74,
+ missCount: 0,
),
- // 42.30769230769231%.
+ // 100.0%.
"package:front_end/src/type_inference/type_schema.dart": (
hitCount: 11,
- missCount: 15,
+ missCount: 0,
),
- // 88.88888888888889%.
+ // 100.0%.
"package:front_end/src/type_inference/type_schema_elimination.dart": (
hitCount: 32,
- missCount: 4,
+ missCount: 0,
),
- // 94.33198380566802%.
+ // 100.0%.
"package:front_end/src/type_inference/type_schema_environment.dart": (
hitCount: 233,
- missCount: 14,
+ missCount: 0,
),
- // 0.0%.
+ // 100.0%.
"package:front_end/src/util/error_reporter_file_copier.dart": (
hitCount: 0,
- missCount: 11,
+ missCount: 0,
),
- // 85.71428571428571%.
+ // 100.0%.
"package:front_end/src/util/experiment_environment_getter.dart": (
hitCount: 6,
- missCount: 1,
+ missCount: 0,
),
- // 52.63157894736842%.
+ // 100.0%.
"package:front_end/src/util/helpers.dart": (
hitCount: 20,
- missCount: 18,
+ missCount: 0,
),
- // 5.611510791366906%.
+ // 100.0%.
"package:front_end/src/util/parser_ast.dart": (
hitCount: 78,
- missCount: 1312,
+ missCount: 0,
),
- // 85.79439252336448%.
+ // 100.0%.
"package:front_end/src/util/textual_outline.dart": (
- hitCount: 459,
- missCount: 76,
+ hitCount: 463,
+ missCount: 0,
),
};
diff --git a/pkg/front_end/tool/coverage_merger.dart b/pkg/front_end/tool/coverage_merger.dart
index e2679c4..57544ae 100644
--- a/pkg/front_end/tool/coverage_merger.dart
+++ b/pkg/front_end/tool/coverage_merger.dart
@@ -651,6 +651,8 @@
"debug",
"debugString",
"toString",
+ "hashCode",
+ "==",
"debugName",
"writeNullabilityOn",
};
@@ -772,7 +774,10 @@
}
if (allSortedIndex >= allSorted.length ||
- allSorted[allSortedIndex] > endToken.charEnd) {
+ // We use >= here because e.g. "assert(a, 'msg')" has `a.charEnd` and
+ // `,.charOffset` to be equal but it logically belongs to the comma
+ //(which for whatever reason can a possible coverage point).
+ allSorted[allSortedIndex] >= endToken.charEnd) {
// Nothing inside this block can be covered by the VM anyway.
return false;
}
@@ -793,7 +798,10 @@
}
if (hitsSortedIndex >= hitsSorted.length ||
- hitsSorted[hitsSortedIndex] > endToken.charEnd) {
+ // We use >= here because e.g. "assert(a, 'msg')" has `a.charEnd` and
+ // `,.charOffset` to be equal but it logically belongs to the comma
+ //(which for whatever reason can a possible coverage point).
+ hitsSorted[hitsSortedIndex] >= endToken.charEnd) {
// No hits at all or next hit is after this "block".
potentiallyAddCommentTokens.add(new _CommentOn(
commentOnToken: tokenWithPossibleComment,