[_fe_analyzer_shared] Update non-exhaustive message
This updates the message report for non-exhaustive switch statements
and expressions to include the witness in the problem message and
a reduced witness, which doesn't include properties that fully cover the
static type. The message is also split into two messages; one for
switch statements and one for switch expressions, allowing for a
better wording regarding the default/wildcard pattern case.
Change-Id: I17db657ef12ade5d47fa96bf69b8807e33ed5b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293040
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart
index df3680c..dacb5f3 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart
@@ -105,12 +105,19 @@
}
}
for (SingleSpace firstValuePattern in firstValuePatterns.singleSpaces) {
+ StaticType contextType = firstValuePattern.type;
List<StaticType> stack = [firstValuePattern.type];
while (stack.isNotEmpty) {
StaticType type = stack.removeAt(0);
if (type.isSealed) {
- Witness? result = _filterByType(type, caseRows, firstValuePattern,
- valuePatterns, witnessPredicates, firstValuePatterns.path);
+ Witness? result = _filterByType(
+ contextType,
+ type,
+ caseRows,
+ firstValuePattern,
+ valuePatterns,
+ witnessPredicates,
+ firstValuePatterns.path);
if (result == null) {
// This type was fully handled so no need to test its
// subtypes.
@@ -120,8 +127,14 @@
stack.addAll(type.getSubtypes(keysOfInterest));
}
} else {
- Witness? result = _filterByType(type, caseRows, firstValuePattern,
- valuePatterns, witnessPredicates, firstValuePatterns.path);
+ Witness? result = _filterByType(
+ contextType,
+ type,
+ caseRows,
+ firstValuePattern,
+ valuePatterns,
+ witnessPredicates,
+ firstValuePatterns.path);
// If we found a witness for a subtype that no rows match, then we
// can stop. There may be others but we don't need to find more.
@@ -136,6 +149,7 @@
}
Witness? _filterByType(
+ StaticType contextType,
StaticType type,
List<List<Space>> caseRows,
SingleSpace firstSingleSpaceValue,
@@ -146,7 +160,7 @@
// Extend the witness with the type we're matching.
List<Predicate> extendedWitness = [
...witnessPredicates,
- new Predicate(path, type)
+ new Predicate(path, contextType, type)
];
// 1) Discard any rows that might not match because the column's type isn't
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart
index c74f287..49ac848 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart
@@ -97,8 +97,14 @@
String spaceToText(Map<Key, Space> spaceProperties,
Map<Key, Space> additionalSpaceProperties);
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields);
+ /// Write this [witness] with the [witnessFields] as a pattern into [buffer]
+ /// using this [StaticType] to determine the syntax.
+ ///
+ /// If [forCorrection] is true, [witnessFields] that fully cover their static
+ /// type are omitted if possible.
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection});
}
mixin _ObjectFieldMixin on _BaseStaticType {
@@ -176,8 +182,9 @@
}
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
if (this == StaticType.nullableObject && witnessFields.isEmpty) {
buffer.write('_');
} else if (this == StaticType.nullType && witnessFields.isEmpty) {
@@ -186,14 +193,14 @@
buffer.write(name);
buffer.write('(');
String comma = '';
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
- FieldWitness witness = entry.value;
+ PropertyWitness witness = entry.value;
buffer.write(comma);
comma = ', ';
buffer.write(key.name);
buffer.write(': ');
- witness.witnessToText(buffer);
+ witness.witnessToText(buffer, forCorrection: forCorrection);
}
buffer.write(')');
}
@@ -401,9 +408,11 @@
}
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
- return wrappedType.witnessToText(buffer, witness, witnessFields);
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
+ return wrappedType.witnessToText(buffer, witness, witnessFields,
+ forCorrection: forCorrection);
}
@override
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/test_helper.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/test_helper.dart
index 776127e..9ac8604 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/test_helper.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/test_helper.dart
@@ -80,7 +80,13 @@
String errorToText(ExhaustivenessError error) {
if (error is NonExhaustiveError) {
- return 'non-exhaustive:${error.witness}';
+ String witnessText = error.witness.asWitness;
+ String correctionText = error.witness.asCorrection;
+ if (witnessText != correctionText) {
+ return 'non-exhaustive:$witnessText/$correctionText';
+ } else {
+ return 'non-exhaustive:$witnessText';
+ }
} else {
assert(error is UnreachableCaseError);
return 'unreachable';
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart
index 10fe31d..d887d9b 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart
@@ -70,8 +70,9 @@
Type get typeForTesting => _type;
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
if (!_typeOperations.hasSimpleName(_type)) {
buffer.write(name);
buffer.write(' _');
@@ -80,7 +81,7 @@
String additionalStart = ' && Object(';
String additionalEnd = '';
String comma = '';
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
if (key is! ListKey) {
buffer.write(additionalStart);
@@ -91,13 +92,14 @@
buffer.write(key.name);
buffer.write(': ');
- FieldWitness field = entry.value;
- field.witnessToText(buffer);
+ PropertyWitness field = entry.value;
+ field.witnessToText(buffer, forCorrection: forCorrection);
}
}
buffer.write(additionalEnd);
} else {
- super.witnessToText(buffer, witness, witnessFields);
+ super.witnessToText(buffer, witness, witnessFields,
+ forCorrection: forCorrection);
}
}
}
@@ -123,15 +125,16 @@
super.restriction, super.name);
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
buffer.write(name);
// If we have restrictions on the value we create an and pattern.
String additionalStart = ' && Object(';
String additionalEnd = '';
String comma = '';
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
if (key is! RecordKey) {
buffer.write(additionalStart);
@@ -142,8 +145,8 @@
buffer.write(key.name);
buffer.write(': ');
- FieldWitness field = entry.value;
- field.witnessToText(buffer);
+ PropertyWitness field = entry.value;
+ field.witnessToText(buffer, forCorrection: forCorrection);
}
}
buffer.write(additionalEnd);
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart
index e593b4f..5887482 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart
@@ -130,12 +130,13 @@
}
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
int maxHeadSize = 0;
int maxTailSize = 0;
- FieldWitness? restWitness;
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ PropertyWitness? restWitness;
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
if (key is HeadKey && key.index >= maxHeadSize) {
maxHeadSize = key.index + 1;
@@ -155,9 +156,9 @@
for (int index = 0; index < maxHeadSize; index++) {
buffer.write(comma);
Key key = new HeadKey(index);
- FieldWitness? witness = witnessFields[key];
+ PropertyWitness? witness = witnessFields[key];
if (witness != null) {
- witness.witnessToText(buffer);
+ witness.witnessToText(buffer, forCorrection: forCorrection);
} else {
buffer.write('_');
}
@@ -167,16 +168,16 @@
buffer.write(comma);
buffer.write('...');
if (restWitness != null) {
- restWitness.witnessToText(buffer);
+ restWitness.witnessToText(buffer, forCorrection: forCorrection);
}
comma = ', ';
}
for (int index = maxTailSize - 1; index >= 0; index--) {
buffer.write(comma);
Key key = new TailKey(index);
- FieldWitness? witness = witnessFields[key];
+ PropertyWitness? witness = witnessFields[key];
if (witness != null) {
- witness.witnessToText(buffer);
+ witness.witnessToText(buffer, forCorrection: forCorrection);
} else {
buffer.write('_');
}
@@ -188,7 +189,7 @@
String additionalStart = ' && Object(';
String additionalEnd = '';
comma = '';
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
if (key is! ListKey) {
buffer.write(additionalStart);
@@ -199,8 +200,8 @@
buffer.write(key.name);
buffer.write(': ');
- FieldWitness field = entry.value;
- field.witnessToText(buffer);
+ PropertyWitness field = entry.value;
+ field.witnessToText(buffer, forCorrection: forCorrection);
}
}
buffer.write(additionalEnd);
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/map.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/map.dart
index 8d003bd..aaac7a9 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/map.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/map.dart
@@ -30,17 +30,18 @@
}
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
buffer.write('{');
String comma = '';
for (MapKey key in restriction.keys) {
buffer.write(comma);
buffer.write(key.valueAsText);
buffer.write(': ');
- FieldWitness? witness = witnessFields[key];
+ PropertyWitness? witness = witnessFields[key];
if (witness != null) {
- witness.witnessToText(buffer);
+ witness.witnessToText(buffer, forCorrection: forCorrection);
} else {
buffer.write('_');
}
@@ -52,7 +53,7 @@
String additionalStart = ' && Object(';
String additionalEnd = '';
comma = '';
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
if (key is! MapKey) {
buffer.write(additionalStart);
@@ -63,8 +64,8 @@
buffer.write(key.name);
buffer.write(': ');
- FieldWitness field = entry.value;
- field.witnessToText(buffer);
+ PropertyWitness field = entry.value;
+ field.witnessToText(buffer, forCorrection: forCorrection);
}
}
buffer.write(additionalEnd);
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart
index fbeaf8c..8ec438d 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart
@@ -92,8 +92,9 @@
}
@override
- void witnessToText(StringBuffer buffer, FieldWitness witness,
- Map<Key, FieldWitness> witnessFields) {
+ void witnessToText(StringBuffer buffer, PropertyWitness witness,
+ Map<Key, PropertyWitness> witnessFields,
+ {required bool forCorrection}) {
buffer.write('(');
String comma = '';
for (Key key in fields.keys) {
@@ -101,9 +102,9 @@
buffer.write(comma);
comma = ', ';
- FieldWitness? field = witnessFields[key];
+ PropertyWitness? field = witnessFields[key];
if (field != null) {
- field.witnessToText(buffer);
+ field.witnessToText(buffer, forCorrection: forCorrection);
} else {
buffer.write('_');
}
@@ -113,9 +114,9 @@
buffer.write(key.name);
buffer.write(': ');
- FieldWitness? field = witnessFields[key];
+ PropertyWitness? field = witnessFields[key];
if (field != null) {
- field.witnessToText(buffer);
+ field.witnessToText(buffer, forCorrection: forCorrection);
} else {
buffer.write('_');
}
@@ -127,7 +128,7 @@
String additionalStart = ' && Object(';
String additionalEnd = '';
comma = '';
- for (MapEntry<Key, FieldWitness> entry in witnessFields.entries) {
+ for (MapEntry<Key, PropertyWitness> entry in witnessFields.entries) {
Key key = entry.key;
if (key is! RecordKey) {
buffer.write(additionalStart);
@@ -138,8 +139,8 @@
buffer.write(key.name);
buffer.write(': ');
- FieldWitness field = entry.value;
- field.witnessToText(buffer);
+ PropertyWitness field = entry.value;
+ field.witnessToText(buffer, forCorrection: forCorrection);
}
}
buffer.write(additionalEnd);
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart
index bda8335..cc197ac 100644
--- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/witness.dart
@@ -14,16 +14,19 @@
/// tested by this predicate.
final Path path;
+ /// The static type of the context. [valueType] is a subtype of this type.
+ final StaticType staticType;
+
/// The type this predicate tests.
// TODO(johnniwinther): In order to model exhaustiveness on enum types,
// bool values, and maybe integers at some point, we may later want a separate
// kind of predicate that means "this value was equal to this constant".
- final StaticType type;
+ final StaticType valueType;
- Predicate(this.path, this.type);
+ Predicate(this.path, this.staticType, this.valueType);
@override
- String toString() => 'Predicate(path=$path,type=$type)';
+ String toString() => 'Predicate(path=$path,type=$valueType)';
}
/// Witness that show an unmatched case.
@@ -46,62 +49,99 @@
/// 'U(w: T(x: B, y: B), z: T(x: C, y: B))'
class Witness {
final List<Predicate> _predicates;
- late final FieldWitness _witness = _buildWitness();
+ late final PropertyWitness _witness = _buildWitness();
Witness(this._predicates);
- FieldWitness _buildWitness() {
- FieldWitness witness = new FieldWitness();
+ PropertyWitness _buildWitness() {
+ PropertyWitness witness = new PropertyWitness();
for (Predicate predicate in _predicates) {
- FieldWitness here = witness;
+ PropertyWitness here = witness;
for (Key field in predicate.path.toList()) {
- here = here.fields.putIfAbsent(field, () => new FieldWitness());
+ here = here.properties.putIfAbsent(field, () => new PropertyWitness());
}
- here.type = predicate.type;
+ here.staticType = predicate.staticType;
+ here.valueType = predicate.valueType;
}
return witness;
}
+ String get asWitness => _witness.asWitness;
+
+ String get asCorrection => _witness.asCorrection;
+
@override
String toString() => _witness.toString();
}
/// Helper class used to turn a list of [Predicates] into a string.
-class FieldWitness {
- StaticType type = StaticType.nullableObject;
- final Map<Key, FieldWitness> fields = {};
+class PropertyWitness {
+ StaticType staticType = StaticType.nullableObject;
+ StaticType valueType = StaticType.nullableObject;
+ final Map<Key, PropertyWitness> properties = {};
- void witnessToText(StringBuffer buffer) {
- if (fields.isNotEmpty) {
- Map<StaticType, Map<Key, FieldWitness>> witnessFieldsByType = {};
- for (MapEntry<Key, FieldWitness> entry in fields.entries) {
+ void witnessToText(StringBuffer buffer, {required bool forCorrection}) {
+ if (properties.isNotEmpty) {
+ Map<StaticType, Map<Key, PropertyWitness>> witnessFieldsByType = {};
+ for (MapEntry<Key, PropertyWitness> entry in properties.entries) {
Key key = entry.key;
- FieldWitness witness = entry.value;
+ PropertyWitness witness = entry.value;
+ if (forCorrection && witness.isTrivial) {
+ continue;
+ }
if (key is ExtensionKey) {
(witnessFieldsByType[key.receiverType] ??= {})[key] = witness;
} else {
- (witnessFieldsByType[type] ??= {})[key] = witness;
+ (witnessFieldsByType[valueType] ??= {})[key] = witness;
}
}
- String and = '';
- for (MapEntry<StaticType, Map<Key, FieldWitness>> entry
- in witnessFieldsByType.entries) {
- StaticType type = entry.key;
- Map<Key, FieldWitness> witnessFields = entry.value;
- buffer.write(and);
- and = ' && ';
- type.witnessToText(buffer, this, witnessFields);
+ if (witnessFieldsByType.isNotEmpty) {
+ String and = '';
+ for (MapEntry<StaticType, Map<Key, PropertyWitness>> entry
+ in witnessFieldsByType.entries) {
+ StaticType type = entry.key;
+ Map<Key, PropertyWitness> witnessFields = entry.value;
+ buffer.write(and);
+ and = ' && ';
+ type.witnessToText(buffer, this, witnessFields,
+ forCorrection: forCorrection);
+ }
+ } else {
+ valueType.witnessToText(buffer, this, const {},
+ forCorrection: forCorrection);
}
} else {
- type.witnessToText(buffer, this, fields);
+ valueType.witnessToText(buffer, this, const {},
+ forCorrection: forCorrection);
}
}
- @override
- String toString() {
+ bool get isTrivial {
+ if (!staticType.isSubtypeOf(valueType)) return false;
+ for (PropertyWitness property in properties.values) {
+ if (!property.isTrivial) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /// Returns the witness as pattern syntax including all subproperties.
+ String get asWitness {
StringBuffer sb = new StringBuffer();
- witnessToText(sb);
+ witnessToText(sb, forCorrection: false);
return sb.toString();
}
+
+ /// Return the witness as pattern syntax without subproperties that fully
+ /// match the static type.
+ String get asCorrection {
+ StringBuffer sb = new StringBuffer();
+ witnessToText(sb, forCorrection: true);
+ return sb.toString();
+ }
+
+ @override
+ String toString() => asWitness;
}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/and_pattern.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/and_pattern.dart
index f56591a..fb09d47 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/and_pattern.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/and_pattern.dart
@@ -73,7 +73,7 @@
[field1, hashCode],
};
var c = /*
- error=non-exhaustive:A(field1: C(), field2: C(), hashCode: int()),
+ error=non-exhaustive:A(field1: C(), field2: C(), hashCode: int())/A(field1: C(), field2: C()),
fields={field1:B,field2:B,hashCode:int},
type=A
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/class_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/class_members.dart
index ab97329..1176185 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/class_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/class_members.dart
@@ -97,7 +97,7 @@
nonExhaustiveMethodRestrictedValue(Class c) {
return /*
- error=non-exhaustive:Class(method: num Function(num) _),
+ error=non-exhaustive:Class(method: num Function(num) _)/Class(),
fields={method:num Function(num)},
type=Class
*/
@@ -131,7 +131,7 @@
exhaustiveMethodRestrictedType(Class c) {
return /*
- error=non-exhaustive:Class(method: num Function(num) _),
+ error=non-exhaustive:Class(method: num Function(num) _)/Class(),
fields={method:num Function(num)},
type=Class
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/dynamic_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/dynamic_members.dart
index caa3d03..5744bdf 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/dynamic_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/dynamic_members.dart
@@ -106,7 +106,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
checkingOrder={Object?,Object,Null},
- error=non-exhaustive:Object(hashCode: int()),
+ error=non-exhaustive:Object(hashCode: int())/Object(),
fields={hashCode:int},
subtypes={Object,Null},
type=Object?
@@ -119,7 +119,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
checkingOrder={Object?,Object,Null},
- error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _)/Object(),
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={Object,Null},
type=Object?
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/enum_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/enum_members.dart
index 763270f..63c7e3b9 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/enum_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/enum_members.dart
@@ -100,7 +100,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
checkingOrder={E,E.a,E.b,E.c},
- error=non-exhaustive:E.a && Object(hashCode: int()),
+ error=non-exhaustive:E.a && Object(hashCode: int())/E.a,
fields={hashCode:int},
subtypes={E.a,E.b,E.c},
type=E
@@ -113,7 +113,7 @@
exhaustiveRestrictedValue(Typedef o) {
return /*
checkingOrder={E,E.a,E.b,E.c},
- error=non-exhaustive:E.b && Object(hashCode: int()),
+ error=non-exhaustive:E.b && Object(hashCode: int())/E.b,
fields={hashCode:int},
subtypes={E.a,E.b,E.c},
type=E
@@ -127,7 +127,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
checkingOrder={E,E.a,E.b,E.c},
- error=non-exhaustive:E.a && Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:E.a && Object(noSuchMethod: dynamic Function(Invocation) _)/E.a,
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={E.a,E.b,E.c},
type=E
@@ -143,7 +143,7 @@
exhaustiveRestrictedType(Typedef o) {
return /*
checkingOrder={E,E.a,E.b,E.c},
- error=non-exhaustive:E.b && Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:E.b && Object(noSuchMethod: dynamic Function(Invocation) _)/E.b,
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={E.a,E.b,E.c},
type=E
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/extension_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/extension_members.dart
index 9bdf411..88298e9 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/extension_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/extension_members.dart
@@ -79,7 +79,7 @@
nonExhaustiveBCD_Restricted(A a) {
/*
checkingOrder={A,B,C,D},
- error=non-exhaustive:B(member: B()),
+ error=non-exhaustive:B(member: B())/B(),
fields={member:-,B.member:B,C.member:C},
subtypes={B,C,D},
type=A
@@ -148,7 +148,7 @@
nonExhaustiveI_Typed(A a) {
/*
checkingOrder={A,B,C,D},
- error=non-exhaustive:I(member: B()),
+ error=non-exhaustive:I(member: B())/B(),
fields={member:-,C.member:C,I.member:B},
subtypes={B,C,D},
type=A
@@ -229,7 +229,7 @@
nonExhaustiveIJ_Restricted(A a) {
/*
checkingOrder={A,B,C,D},
- error=non-exhaustive:I(member: B()) && J(member: double()),
+ error=non-exhaustive:I(member: B()) && J(member: double())/J(member: double()),
fields={member:-,C.member:C,I.member:B,J.member:num},
subtypes={B,C,D},
type=A
@@ -268,7 +268,7 @@
nonExhaustiveIJ_MultipleRestricted(A a) {
/*
checkingOrder={A,B,C,D},
- error=non-exhaustive:I(member: B(), member2: B(), member3: C()) && J(member: double(), member2: C(), member3: true),
+ error=non-exhaustive:I(member: B(), member2: B(), member3: C()) && J(member: double(), member2: C(), member3: true)/I(member2: B()) && J(member: double(), member2: C(), member3: true),
fields={member:-,C.member:C,I.member:B,I.member2:A,I.member3:C,J.member:num,J.member2:A,J.member3:bool},
subtypes={B,C,D},
type=A
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/function_type_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/function_type_members.dart
index 5b9e1bb..c4cb6f34 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/function_type_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/function_type_members.dart
@@ -90,7 +90,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
- error=non-exhaustive:void Function() _ && Object(hashCode: int()),
+ error=non-exhaustive:void Function() _ && Object(hashCode: int())/void Function() _,
fields={hashCode:int},
type=void Function()
*/
@@ -101,7 +101,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
- error=non-exhaustive:void Function() _ && Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:void Function() _ && Object(noSuchMethod: dynamic Function(Invocation) _)/void Function() _,
fields={noSuchMethod:dynamic Function(Invocation)},
type=void Function()
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart
index 5b05532..09490ac8 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart
@@ -131,14 +131,14 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
- error=non-exhaustive:Null(hashCode: int()),
+ error=non-exhaustive:Null(hashCode: int())/null,
expandedSubtypes={Object,Null,Future<dynamic>},
fields={hashCode:int},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
- error=non-exhaustive:Future<dynamic>(hashCode: int()),
+ error=non-exhaustive:Future<dynamic>(hashCode: int())/Future<dynamic>(),
expandedSubtypes={Object,Null,Future<dynamic>},
fields={hashCode:int},
subtypes={Object?,Future<dynamic>},
@@ -152,14 +152,14 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
- error=non-exhaustive:Null(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Null(noSuchMethod: dynamic Function(Invocation) _)/null,
expandedSubtypes={Object,Null,Future<dynamic>},
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
- error=non-exhaustive:Future<dynamic>(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Future<dynamic>(noSuchMethod: dynamic Function(Invocation) _)/Future<dynamic>(),
expandedSubtypes={Object,Null,Future<dynamic>},
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={Object?,Future<dynamic>},
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51854.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51854.dart
index 862da3b..9974d07 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51854.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/issue51854.dart
@@ -39,10 +39,10 @@
int sum2(
Iterable<int>
list) => /*
- error=non-exhaustive:Iterable<int>(first: int(), isEmpty: false, rest: Iterable<int>()),
- fields={first:int,isEmpty:bool,Iterable<int>.rest:Iterable<int>},
- type=Iterable<int>
-*/
+ error=non-exhaustive:Iterable<int>(first: int(), isEmpty: false, rest: Iterable<int>())/Iterable<int>(isEmpty: false),
+ fields={first:int,isEmpty:bool,Iterable<int>.rest:Iterable<int>},
+ type=Iterable<int>
+ */
switch (list) {
Iterable(isEmpty: true) /*space=Iterable<int>(isEmpty: true)*/ => 0,
Iterable(
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/list.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/list.dart
index 0347674..daadbf1 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/list.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/list.dart
@@ -49,7 +49,7 @@
};
var b = /*
checkingOrder={List<dynamic>,[...]},
- error=non-exhaustive:[...[...]],
+ error=non-exhaustive:[...[...]]/[...],
subtypes={[...]},
type=List<dynamic>
*/
@@ -341,7 +341,7 @@
nonExhaustiveRestrictedRest(List list) {
return /*
checkingOrder={List<dynamic>,[],[()],[(), ()],[(), (), (), ...]},
- error=non-exhaustive:[Object(), Object(), Object(), ...[...]],
+ error=non-exhaustive:[Object(), Object(), Object(), ...[...]]/[Object(), Object(), Object(), ...],
subtypes={[],[()],[(), ()],[(), (), (), ...]},
type=List<dynamic>
*/
@@ -452,17 +452,32 @@
};
}
-nonExhaustiveSealed(List<A> list) {
+nonExhaustiveSealedSubtype(List<A> list) {
return /*
- checkingOrder={List<A>,<A>[],<A>[()],<A>[(), (), ...]},
- error=non-exhaustive:[C()],
- subtypes={<A>[],<A>[()],<A>[(), (), ...]},
+ checkingOrder={List<A>,<A>[],<A>[()],<A>[(), ()],<A>[(), (), (), ...]},
+ error=non-exhaustive:[B(), C()],
+ subtypes={<A>[],<A>[()],<A>[(), ()],<A>[(), (), (), ...]},
type=List<A>
*/
switch (list) {
[] /*space=<[]>*/ => 0,
- [B()] /*space=<[B]>*/ => 1,
- [_, _, ...] /*space=<[A, A, ...List<A>]>*/ => 3,
+ [_] /*space=<[A]>*/ => 1,
+ [_, B()] /*space=<[A, B]>*/ => 2,
+ [_, _, _, ...] /*space=<[A, A, A, ...List<A>]>*/ => 3,
+ };
+}
+
+nonExhaustiveSealedCount(List<A> list) {
+ return /*
+ checkingOrder={List<A>,<A>[],<A>[()],<A>[(), ()],<A>[(), (), (), ...]},
+ error=non-exhaustive:[_, _],
+ subtypes={<A>[],<A>[()],<A>[(), ()],<A>[(), (), (), ...]},
+ type=List<A>
+ */
+ switch (list) {
+ [] /*space=<[]>*/ => 0,
+ [_] /*space=<[A]>*/ => 1,
+ [_, _, _, ...] /*space=<[A, A, A, ...List<A>]>*/ => 3,
};
}
@@ -485,3 +500,32 @@
4,
};
}
+
+nonExhaustiveSubtype(List<Object> list) {
+ return /*
+ checkingOrder={List<Object>,<Object>[],<Object>[()],<Object>[(), ()],<Object>[(), (), (), ...]},
+ error=non-exhaustive:[Object(), Object()]/[_, _],
+ subtypes={<Object>[],<Object>[()],<Object>[(), ()],<Object>[(), (), (), ...]},
+ type=List<Object>
+ */
+ switch (list) {
+ [] /*space=<[]>*/ => 0,
+ [_] /*space=<[Object]>*/ => 1,
+ [_, String()] /*space=<[Object, String]>*/ => 2,
+ [_, _, _, ...] /*space=<[Object, Object, Object, ...List<Object>]>*/ => 3,
+ };
+}
+
+nonExhaustiveCount(List<Object> list) {
+ return /*
+ checkingOrder={List<Object>,<Object>[],<Object>[()],<Object>[(), ()],<Object>[(), (), (), ...]},
+ error=non-exhaustive:[_, _],
+ subtypes={<Object>[],<Object>[()],<Object>[(), ()],<Object>[(), (), (), ...]},
+ type=List<Object>
+ */
+ switch (list) {
+ [] /*space=<[]>*/ => 0,
+ [_] /*space=<[Object]>*/ => 1,
+ [_, _, _, ...] /*space=<[Object, Object, Object, ...List<Object>]>*/ => 3,
+ };
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/never_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/never_members.dart
index 15cae4c..92e81d2 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/never_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/never_members.dart
@@ -69,7 +69,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
- error=non-exhaustive:Never(hashCode: int()),
+ error=non-exhaustive:Never(hashCode: int())/Never(),
fields={hashCode:int},
type=Never
*/
@@ -80,7 +80,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
- error=non-exhaustive:Never(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Never(noSuchMethod: dynamic Function(Invocation) _)/Never(),
fields={noSuchMethod:dynamic Function(Invocation)},
type=Never
*/
@@ -94,7 +94,7 @@
unreachableMethod(Typedef o) {
return /*
- error=non-exhaustive:Never(hashCode: int(), noSuchMethod: dynamic Function(Invocation) _, runtimeType: Type(), toString: String Function() _),
+ error=non-exhaustive:Never(hashCode: int(), noSuchMethod: dynamic Function(Invocation) _, runtimeType: Type(), toString: String Function() _)/Never(),
fields={hashCode:int,noSuchMethod:dynamic Function(Invocation),runtimeType:Type,toString:String Function()},
type=Never
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_assert.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_assert.dart
index 9c11c5f..e108923 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_assert.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_assert.dart
@@ -115,7 +115,7 @@
};
var c = /*
checkingOrder={A?,A,Null},
- error=non-exhaustive:A(field: int()),
+ error=non-exhaustive:A(field: int())/A(),
fields={field:-},
subtypes={A,Null},
type=A?
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_members.dart
index da226b2..81a43cb 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/null_members.dart
@@ -89,7 +89,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
- error=non-exhaustive:Null(hashCode: int()),
+ error=non-exhaustive:Null(hashCode: int())/null,
fields={hashCode:int},
type=Null
*/
@@ -100,7 +100,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
- error=non-exhaustive:Null(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Null(noSuchMethod: dynamic Function(Invocation) _)/null,
fields={noSuchMethod:dynamic Function(Invocation)},
type=Null
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/nullable_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/nullable_members.dart
index 1299f0d..f0be6d6 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/nullable_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/nullable_members.dart
@@ -104,7 +104,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
checkingOrder={Object?,Object,Null},
- error=non-exhaustive:Object(hashCode: int()),
+ error=non-exhaustive:Object(hashCode: int())/Object(),
fields={hashCode:int},
subtypes={Object,Null},
type=Object?
@@ -117,7 +117,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
checkingOrder={Object?,Object,Null},
- error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _)/Object(),
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={Object,Null},
type=Object?
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/object_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/object_members.dart
index c47068b..04059ced 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/object_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/object_members.dart
@@ -90,7 +90,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
- error=non-exhaustive:Object(hashCode: int()),
+ error=non-exhaustive:Object(hashCode: int())/Object(),
fields={hashCode:int},
type=Object
*/
@@ -101,7 +101,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
- error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _)/Object(),
fields={noSuchMethod:dynamic Function(Invocation)},
type=Object
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/record_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/record_members.dart
index c4536cd..c5cdd6e 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/record_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/record_members.dart
@@ -90,7 +90,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
- error=non-exhaustive:(_, _) && Object(hashCode: int()),
+ error=non-exhaustive:(_, _) && Object(hashCode: int())/(_, _),
fields={hashCode:int},
type=(int, String)
*/
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/type_variable_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/type_variable_members.dart
index cbeb50b..47ae366 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/type_variable_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/type_variable_members.dart
@@ -98,7 +98,7 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*
checkingOrder={Object?,Object,Null},
- error=non-exhaustive:Object(hashCode: int()),
+ error=non-exhaustive:Object(hashCode: int())/Object(),
fields={hashCode:int},
subtypes={Object,Null},
type=Object?
@@ -111,7 +111,7 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*
checkingOrder={Object?,Object,Null},
- error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:Object(noSuchMethod: dynamic Function(Invocation) _)/Object(),
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={Object,Null},
type=Object?
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart
index ec0b042..6edb5d6 100644
--- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart
@@ -110,12 +110,12 @@
nonExhaustiveRestrictedValue(Typedef o) {
return /*cfe.
checkingOrder={void,void,Null},
- error=non-exhaustive:void(hashCode: int()),
+ error=non-exhaustive:void(hashCode: int())/void(),
fields={hashCode:int},
subtypes={void,Null},
type=void
*/ /*analyzer.
- error=non-exhaustive:void(hashCode: int()),
+ error=non-exhaustive:void(hashCode: int())/void(),
fields={hashCode:int},
type=void
*/
@@ -127,12 +127,12 @@
nonExhaustiveRestrictedType(Typedef o) {
return /*cfe.
checkingOrder={void,void,Null},
- error=non-exhaustive:void(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:void(noSuchMethod: dynamic Function(Invocation) _)/void(),
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={void,Null},
type=void
*/ /*analyzer.
- error=non-exhaustive:void(noSuchMethod: dynamic Function(Invocation) _),
+ error=non-exhaustive:void(noSuchMethod: dynamic Function(Invocation) _)/void(),
fields={noSuchMethod:dynamic Function(Invocation)},
type=void
*/
diff --git a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
index c1711e5..061502d 100644
--- a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
+++ b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
@@ -988,7 +988,9 @@
Make the pattern expression a constant.
CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT:
status: needsEvaluation
-CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH:
+CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION:
+ status: needsEvaluation
+CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT:
status: needsEvaluation
CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM:
status: hasFix
diff --git a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
index 276ab5c..a70bc22 100644
--- a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
+++ b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
@@ -403,6 +403,7 @@
mapPatternKeyValues: mapPatternKeyValues,
constantPatternValues: constantPatternValues,
mustBeExhaustive: true,
+ isSwitchExpression: true,
);
});
}
@@ -421,6 +422,7 @@
constantPatternValues: constantPatternValues,
mustBeExhaustive:
_typeSystem.isAlwaysExhaustive(node.expression.typeOrThrow),
+ isSwitchExpression: false,
);
} else if (_currentLibrary.isNonNullableByDefault) {
_validateSwitchStatement_nullSafety(node);
@@ -768,6 +770,7 @@
required Map<Expression, DartObjectImpl> mapPatternKeyValues,
required Map<ConstantPattern, DartObjectImpl> constantPatternValues,
required bool mustBeExhaustive,
+ required bool isSwitchExpression,
}) {
final scrutineeType = scrutinee.typeOrThrow;
final scrutineeTypeEx = _exhaustivenessCache.getStaticType(scrutineeType);
@@ -828,9 +831,11 @@
);
} else if (error is NonExhaustiveError && reportNonExhaustive) {
_errorReporter.reportErrorForToken(
- CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH,
+ isSwitchExpression
+ ? CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION
+ : CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT,
switchKeyword,
- [scrutineeType, error.witness.toString()],
+ [scrutineeType, error.witness.asWitness, error.witness.asCorrection],
);
}
}
diff --git a/pkg/analyzer/lib/src/error/codes.g.dart b/pkg/analyzer/lib/src/error/codes.g.dart
index c0b4c40..04a0daa 100644
--- a/pkg/analyzer/lib/src/error/codes.g.dart
+++ b/pkg/analyzer/lib/src/error/codes.g.dart
@@ -3480,12 +3480,28 @@
/// Parameters:
/// 0: the type of the switch scrutinee
- /// 1: the unmatched space
- static const CompileTimeErrorCode NON_EXHAUSTIVE_SWITCH =
+ /// 1: the witness pattern for the unmatched value
+ /// 2: the suggested pattern for the unmatched value
+ static const CompileTimeErrorCode NON_EXHAUSTIVE_SWITCH_EXPRESSION =
CompileTimeErrorCode(
- 'NON_EXHAUSTIVE_SWITCH',
- "The type '{0}' is not exhaustively matched by the switch cases.",
- correctionMessage: "Try adding a default case or cases that match '{1}'.",
+ 'NON_EXHAUSTIVE_SWITCH_EXPRESSION',
+ "The type '{0}' is not exhaustively matched by the switch cases since it "
+ "doesn't match '{1}'.",
+ correctionMessage:
+ "Try adding a wildcard pattern or cases that match '{2}'.",
+ hasPublishedDocs: true,
+ );
+
+ /// Parameters:
+ /// 0: the type of the switch scrutinee
+ /// 1: the witness pattern for the unmatched value
+ /// 2: the suggested pattern for the unmatched value
+ static const CompileTimeErrorCode NON_EXHAUSTIVE_SWITCH_STATEMENT =
+ CompileTimeErrorCode(
+ 'NON_EXHAUSTIVE_SWITCH_STATEMENT',
+ "The type '{0}' is not exhaustively matched by the switch cases since it "
+ "doesn't match '{1}'.",
+ correctionMessage: "Try adding a default case or cases that match '{2}'.",
hasPublishedDocs: true,
);
diff --git a/pkg/analyzer/lib/src/error/error_code_values.g.dart b/pkg/analyzer/lib/src/error/error_code_values.g.dart
index ab5d67e..8713ead 100644
--- a/pkg/analyzer/lib/src/error/error_code_values.g.dart
+++ b/pkg/analyzer/lib/src/error/error_code_values.g.dart
@@ -357,7 +357,8 @@
CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT,
CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR,
CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
- CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH,
+ CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION,
+ CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT,
CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM,
CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
CompileTimeErrorCode.NON_GENERATIVE_IMPLICIT_CONSTRUCTOR,
diff --git a/pkg/analyzer/messages.yaml b/pkg/analyzer/messages.yaml
index 2a75671..494b6bfc 100644
--- a/pkg/analyzer/messages.yaml
+++ b/pkg/analyzer/messages.yaml
@@ -10924,14 +10924,75 @@
13.2 Expression Statements: It is a compile-time error if a non-constant
map literal that has no explicit type arguments appears in a place where a
statement is expected.
- NON_EXHAUSTIVE_SWITCH:
- problemMessage: "The type '{0}' is not exhaustively matched by the switch cases."
- correctionMessage: "Try adding a default case or cases that match '{1}'."
+ NON_EXHAUSTIVE_SWITCH_EXPRESSION:
+ problemMessage: "The type '{0}' is not exhaustively matched by the switch cases since it doesn't match '{1}'."
+ correctionMessage: "Try adding a wildcard pattern or cases that match '{2}'."
hasPublishedDocs: true
comment: |-
Parameters:
0: the type of the switch scrutinee
- 1: the unmatched space
+ 1: the witness pattern for the unmatched value
+ 2: the suggested pattern for the unmatched value
+ documentation: |-
+ #### Description
+
+ The analyzer produces this diagnostic when a `switch` expression is
+ missing a case for one or more of the possible values that could flow
+ through it.
+
+ #### Example
+
+ The following code produces this diagnostic because the switch expression
+ doesn't have a case for the value `E.three`:
+
+ ```dart
+ enum E { one, two, three }
+
+ String f(E e) => [!switch!] (e) {
+ E.one => 'one',
+ E.two => 'two',
+ };
+ ```
+
+ #### Common fixes
+
+ Add a case for each of the constants that aren't currently being matched:
+
+ ```dart
+ enum E { one, two, three }
+
+ String f(E e) => switch (e) {
+ E.one => 'one',
+ E.two => 'two',
+ E.three => 'three',
+ };
+ ```
+
+ If the missing values don't need to be matched, then add a wildcard
+ pattern:
+
+ ```dart
+ enum E { one, two, three }
+
+ String f(E e) => switch (e) {
+ E.one => 'one',
+ E.two => 'two',
+ _ => 'unknown',
+ };
+ ```
+
+ But be aware that adding a wildcard pattern will cause any future values
+ of the type to also be handled, so you will have lost the ability for the
+ compiler to warn you if the `switch` needs to be updated.
+ NON_EXHAUSTIVE_SWITCH_STATEMENT:
+ problemMessage: "The type '{0}' is not exhaustively matched by the switch cases since it doesn't match '{1}'."
+ correctionMessage: "Try adding a default case or cases that match '{2}'."
+ hasPublishedDocs: true
+ comment: |-
+ Parameters:
+ 0: the type of the switch scrutinee
+ 1: the witness pattern for the unmatched value
+ 2: the suggested pattern for the unmatched value
documentation: |-
#### Description
@@ -10974,7 +11035,7 @@
```
If the missing values don't need to be matched, then add a `default`
- clause (or a wildcard pattern in a `switch` expression):
+ clause or a wildcard pattern:
```dart
enum E { one, two, three }
diff --git a/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart
index 3815efc..c09eeb1 100644
--- a/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart
@@ -19,7 +19,7 @@
await assertErrorsInCode(r'''
final a = switch (0) {};
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 10, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 10, 6),
]);
final node = findNode.singleSwitchExpression;
diff --git a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart
index 76820c6..a295ef6 100644
--- a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart
@@ -66,7 +66,7 @@
error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 28, 5),
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 40, 13),
] else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 40, 6)
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 40, 6)
]);
}
@@ -197,7 +197,7 @@
error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 23, 1),
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 38, 12),
] else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 38, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 38, 6),
]);
}
@@ -220,7 +220,7 @@
error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 47, 1),
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 58, 10),
] else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 58, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 58, 6),
]);
}
@@ -275,7 +275,7 @@
error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 23, 1),
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 39, 12),
] else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 39, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 39, 6),
]);
}
diff --git a/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart b/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart
index 02c2d09..c7499f7 100644
--- a/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart
@@ -68,7 +68,7 @@
if (!_arePatternsEnabled)
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 44, 10)
else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 44, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 44, 6),
]);
}
@@ -87,7 +87,7 @@
if (!_arePatternsEnabled)
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 44, 10)
else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 44, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 44, 6),
]);
}
@@ -106,7 +106,7 @@
if (!_arePatternsEnabled)
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 44, 10)
else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 44, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 44, 6),
]);
}
@@ -166,7 +166,7 @@
if (!_arePatternsEnabled)
error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 38, 10)
else
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 38, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 38, 6),
]);
}
diff --git a/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart b/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart
index 8490f97..ff364db 100644
--- a/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart
@@ -24,7 +24,7 @@
};
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 28, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 28, 6),
]);
}
@@ -74,7 +74,7 @@
};
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 44, 6,
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 44, 6,
correctionContains: 'E.a'),
]);
}
@@ -91,7 +91,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 19, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 19, 6),
]);
}
@@ -127,7 +127,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 19, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 19, 6),
error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 41, 5),
]);
}
@@ -153,7 +153,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 20, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 20, 6),
]);
}
@@ -183,7 +183,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 35, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 35, 6),
]);
}
@@ -217,7 +217,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 35, 6,
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 35, 6,
correctionContains: 'E.a'),
]);
}
@@ -245,7 +245,7 @@
switch (x) {}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 19, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 19, 6),
]);
}
@@ -287,7 +287,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 77, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 77, 6),
]);
}
@@ -334,7 +334,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 32, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 32, 6),
]);
}
@@ -361,7 +361,7 @@
}
}
''', [
- error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH, 40, 6),
+ error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 40, 6),
]);
}
diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md
index d854631..6b8533d5 100644
--- a/pkg/analyzer/tool/diagnostics/diagnostics.md
+++ b/pkg/analyzer/tool/diagnostics/diagnostics.md
@@ -14277,9 +14277,66 @@
}
{% endprettify %}
-### non_exhaustive_switch
+### non_exhaustive_switch_expression
-_The type '{0}' is not exhaustively matched by the switch cases._
+_The type '{0}' is not exhaustively matched by the switch cases since it doesn't
+match '{1}'._
+
+#### Description
+
+The analyzer produces this diagnostic when a `switch` expression is
+missing a case for one or more of the possible values that could flow
+through it.
+
+#### Example
+
+The following code produces this diagnostic because the switch expression
+doesn't have a case for the value `E.three`:
+
+{% prettify dart tag=pre+code %}
+enum E { one, two, three }
+
+String f(E e) => [!switch!] (e) {
+ E.one => 'one',
+ E.two => 'two',
+ };
+{% endprettify %}
+
+#### Common fixes
+
+Add a case for each of the constants that aren't currently being matched:
+
+{% prettify dart tag=pre+code %}
+enum E { one, two, three }
+
+String f(E e) => switch (e) {
+ E.one => 'one',
+ E.two => 'two',
+ E.three => 'three',
+ };
+{% endprettify %}
+
+If the missing values don't need to be matched, then add a wildcard
+pattern:
+
+{% prettify dart tag=pre+code %}
+enum E { one, two, three }
+
+String f(E e) => switch (e) {
+ E.one => 'one',
+ E.two => 'two',
+ _ => 'unknown',
+ };
+{% endprettify %}
+
+But be aware that adding a wildcard pattern will cause any future values
+of the type to also be handled, so you will have lost the ability for the
+compiler to warn you if the `switch` needs to be updated.
+
+### non_exhaustive_switch_statement
+
+_The type '{0}' is not exhaustively matched by the switch cases since it doesn't
+match '{1}'._
#### Description
@@ -14322,7 +14379,7 @@
{% endprettify %}
If the missing values don't need to be matched, then add a `default`
-clause (or a wildcard pattern in a `switch` expression):
+clause or a wildcard pattern:
{% prettify dart tag=pre+code %}
enum E { one, two, three }
diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
index f70a0cd..8c4a632 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
@@ -4062,42 +4062,78 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
- Message Function(
- DartType _type,
- String string,
- bool
- isNonNullableByDefault)> templateNonExhaustiveSwitch = const Template<
- Message Function(
- DartType _type, String string, bool isNonNullableByDefault)>(
- problemMessageTemplate:
- r"""The type '#type' is not exhaustively matched by the switch cases.""",
- correctionMessageTemplate:
- r"""Try adding a default case or cases that match '#string'.""",
- withArguments: _withArgumentsNonExhaustiveSwitch);
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)>
+ templateNonExhaustiveSwitchExpression = const Template<
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)>(
+ problemMessageTemplate:
+ r"""The type '#type' is not exhaustively matched by the switch cases since it doesn't match '#string'.""",
+ correctionMessageTemplate:
+ r"""Try adding a wildcard pattern or cases that match '#string2'.""",
+ withArguments: _withArgumentsNonExhaustiveSwitchExpression);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<
- Message Function(
- DartType _type, String string, bool isNonNullableByDefault)>
- codeNonExhaustiveSwitch = const Code<
- Message Function(
- DartType _type, String string, bool isNonNullableByDefault)>(
- "NonExhaustiveSwitch",
- analyzerCodes: <String>["NON_EXHAUSTIVE_SWITCH"]);
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)> codeNonExhaustiveSwitchExpression =
+ const Code<
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)>("NonExhaustiveSwitchExpression",
+ analyzerCodes: <String>["NON_EXHAUSTIVE_SWITCH_EXPRESSION"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsNonExhaustiveSwitch(
- DartType _type, String string, bool isNonNullableByDefault) {
+Message _withArgumentsNonExhaustiveSwitchExpression(DartType _type,
+ String string, String string2, bool isNonNullableByDefault) {
TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault);
List<Object> typeParts = labeler.labelType(_type);
if (string.isEmpty) throw 'No string provided';
+ if (string2.isEmpty) throw 'No string provided';
String type = typeParts.join();
- return new Message(codeNonExhaustiveSwitch,
+ return new Message(codeNonExhaustiveSwitchExpression,
problemMessage:
- """The type '${type}' is not exhaustively matched by the switch cases.""" +
+ """The type '${type}' is not exhaustively matched by the switch cases since it doesn't match '${string}'.""" +
labeler.originMessages,
- correctionMessage: """Try adding a default case or cases that match '${string}'.""",
- arguments: {'type': _type, 'string': string});
+ correctionMessage: """Try adding a wildcard pattern or cases that match '${string2}'.""",
+ arguments: {'type': _type, 'string': string, 'string2': string2});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)> templateNonExhaustiveSwitchStatement =
+ const Template<
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)>(
+ problemMessageTemplate:
+ r"""The type '#type' is not exhaustively matched by the switch cases since it doesn't match '#string'.""",
+ correctionMessageTemplate:
+ r"""Try adding a default case or cases that match '#string2'.""",
+ withArguments: _withArgumentsNonExhaustiveSwitchStatement);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)> codeNonExhaustiveSwitchStatement =
+ const Code<
+ Message Function(DartType _type, String string, String string2,
+ bool isNonNullableByDefault)>("NonExhaustiveSwitchStatement",
+ analyzerCodes: <String>["NON_EXHAUSTIVE_SWITCH_STATEMENT"]);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsNonExhaustiveSwitchStatement(DartType _type,
+ String string, String string2, bool isNonNullableByDefault) {
+ TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault);
+ List<Object> typeParts = labeler.labelType(_type);
+ if (string.isEmpty) throw 'No string provided';
+ if (string2.isEmpty) throw 'No string provided';
+ String type = typeParts.join();
+ return new Message(codeNonExhaustiveSwitchStatement,
+ problemMessage:
+ """The type '${type}' is not exhaustively matched by the switch cases since it doesn't match '${string}'.""" +
+ labeler.originMessages,
+ correctionMessage: """Try adding a default case or cases that match '${string2}'.""",
+ arguments: {'type': _type, 'string': string, 'string2': string2});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
diff --git a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
index 771bb4c..e18566d 100644
--- a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
@@ -1498,7 +1498,8 @@
_checkExhaustiveness(node, replacement, scrutineeType, patternGuards,
hasDefault: hasDefault,
mustBeExhaustive: isAlwaysExhaustiveType,
- fileOffset: node.expression.fileOffset);
+ fileOffset: node.expression.fileOffset,
+ isSwitchExpression: false);
// TODO(johnniwinther): Avoid this work-around for [getFileUri].
replacement.parent = node.parent;
// TODO(johnniwinther): Avoid transform of [replacement] by generating
@@ -1510,7 +1511,8 @@
DartType expressionType, List<PatternGuard> patternGuards,
{required int fileOffset,
required bool hasDefault,
- required bool mustBeExhaustive}) {
+ required bool mustBeExhaustive,
+ required bool isSwitchExpression}) {
StaticType type = exhaustivenessCache.getStaticType(expressionType);
List<Space> cases = [];
PatternConverter patternConverter = new PatternConverter(
@@ -1551,8 +1553,14 @@
constantEvaluator.createLocatedMessageWithOffset(
node,
fileOffset,
- templateNonExhaustiveSwitch.withArguments(expressionType,
- '${error.witness}', library.isNonNullableByDefault)));
+ (isSwitchExpression
+ ? templateNonExhaustiveSwitchExpression
+ : templateNonExhaustiveSwitchStatement)
+ .withArguments(
+ expressionType,
+ error.witness.asWitness,
+ error.witness.asCorrection,
+ library.isNonNullableByDefault)));
}
}
if (_exhaustivenessDataForTesting != null) {
@@ -1997,7 +2005,8 @@
_checkExhaustiveness(node, replacement, scrutineeType, patternGuards,
hasDefault: false,
mustBeExhaustive: true,
- fileOffset: node.expression.fileOffset);
+ fileOffset: node.expression.fileOffset,
+ isSwitchExpression: true);
// TODO(johnniwinther): Avoid this work-around for [getFileUri].
replacement.parent = node.parent;
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index d738d92..be7e7d8 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -6390,10 +6390,21 @@
script: |
test(dynamic x) { switch (x) { case [int a]: case [double a] : return a; default: return null; } }
-NonExhaustiveSwitch:
- problemMessage: "The type '#type' is not exhaustively matched by the switch cases."
- correctionMessage: "Try adding a default case or cases that match '#string'."
- analyzerCode: NON_EXHAUSTIVE_SWITCH
+NonExhaustiveSwitchExpression:
+ problemMessage: "The type '#type' is not exhaustively matched by the switch cases since it doesn't match '#string'."
+ correctionMessage: "Try adding a wildcard pattern or cases that match '#string2'."
+ analyzerCode: NON_EXHAUSTIVE_SWITCH_EXPRESSION
+ experiments: patterns
+ script: |
+ enum Enum { a, b }
+ String method(Enum e) => switch (e) {
+ Enum.a => 'a',
+ };
+
+NonExhaustiveSwitchStatement:
+ problemMessage: "The type '#type' is not exhaustively matched by the switch cases since it doesn't match '#string'."
+ correctionMessage: "Try adding a default case or cases that match '#string2'."
+ analyzerCode: NON_EXHAUSTIVE_SWITCH_STATEMENT
experiments: patterns
script: |
enum Enum { a, b }
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index b22e667..6f5c962 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -1472,6 +1472,7 @@
subnode
subnodes
subpatterns
+subproperties
subscription
subsection
subsections
diff --git a/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.expect b/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.expect
index f8db071..6e48e33 100644
--- a/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.expect
@@ -2,37 +2,37 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'null'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'A.b'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'A.b'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases since it doesn't match 'B.b'.
// - 'B' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'B.b'.
// switch (b) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'null'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'C.b'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'C.b'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases since it doesn't match 'D.b'.
// - 'D' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'D.b'.
// switch (d) {
diff --git a/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.transformed.expect
index f8db071..6e48e33 100644
--- a/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/issue49697_2/main.dart.strong.transformed.expect
@@ -2,37 +2,37 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'null'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'A.b'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'A.b'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases since it doesn't match 'B.b'.
// - 'B' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'B.b'.
// switch (b) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'null'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'C.b'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'C.b'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases since it doesn't match 'D.b'.
// - 'D' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'D.b'.
// switch (d) {
diff --git a/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.expect b/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.expect
index 1e38302..a8eee3f 100644
--- a/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.expect
+++ b/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.expect
@@ -2,37 +2,37 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'null'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'A.b'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'A.b'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases since it doesn't match 'B.b'.
// - 'B' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'B.b'.
// switch (b) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'null'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'C.b'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'C.b'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases since it doesn't match 'D.b'.
// - 'D' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'D.b'.
// switch (d) {
diff --git a/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.modular.expect b/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.modular.expect
index b58a94f..3d4b8f5 100644
--- a/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.modular.expect
@@ -2,37 +2,37 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'null'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'A.b'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'A.b'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases since it doesn't match 'B.b'.
// - 'B' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'B.b'.
// switch (b) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'null'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'C.b'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'C.b'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases since it doesn't match 'D.b'.
// - 'D' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'D.b'.
// switch (d) {
diff --git a/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.transformed.expect
index 1e38302..a8eee3f 100644
--- a/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general/issue49697_2/main.dart.weak.transformed.expect
@@ -2,37 +2,37 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:17:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'null'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:24:11: Error: The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'A.b'.
// - 'A' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'A.b'.
// switch (a) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:42:11: Error: The type 'B?' is not exhaustively matched by the switch cases since it doesn't match 'B.b'.
// - 'B' is from 'pkg/front_end/testcases/general/issue49697_2/main.dart'.
// Try adding a default case or cases that match 'B.b'.
// switch (b) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:51:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'null'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:58:11: Error: The type 'C?' is not exhaustively matched by the switch cases since it doesn't match 'C.b'.
// - 'C' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'C.b'.
// switch (c) {
// ^
//
-// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/general/issue49697_2/main.dart:76:11: Error: The type 'D?' is not exhaustively matched by the switch cases since it doesn't match 'D.b'.
// - 'D' is from 'pkg/front_end/testcases/general/issue49697_2/main_lib.dart'.
// Try adding a default case or cases that match 'D.b'.
// switch (d) {
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.expect
index d25c5e4..943fa90 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.expect
@@ -2,22 +2,22 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// Try adding a default case or cases that match 'null'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.transformed.expect
index d25c5e4..943fa90 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.strong.transformed.expect
@@ -2,22 +2,22 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// Try adding a default case or cases that match 'null'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.expect
index 930dc99..5df1cba 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.expect
@@ -2,22 +2,22 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// Try adding a default case or cases that match 'null'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.modular.expect
index 930dc99..5df1cba 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.modular.expect
@@ -2,22 +2,22 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// Try adding a default case or cases that match 'null'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.transformed.expect
index 930dc99..5df1cba 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart.weak.transformed.expect
@@ -2,22 +2,22 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:17:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:25:11: Error: The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:58:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// Try adding a default case or cases that match 'null'.
// switch (b) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/bool_switch.dart:69:11: Error: The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (b) /* Error */ {
// ^
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.expect
index f4e8e27..c407e8b 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'null'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Non-exhaustive */ {
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.transformed.expect
index f4e8e27..c407e8b 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.strong.transformed.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'null'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Non-exhaustive */ {
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.expect
index 5713bb3..c871de7 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'null'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Non-exhaustive */ {
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.modular.expect
index 5713bb3..c871de7 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.modular.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'null'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Non-exhaustive */ {
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.transformed.expect
index 5713bb3..c871de7 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart.weak.transformed.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.a'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'null'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.b'.
// switch (e) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
// - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'.
// Try adding a default case or cases that match 'Enum.c'.
// switch (e) /* Non-exhaustive */ {
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.expect
index 6018765..a968e71 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// var a = switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// var a = switch (x2) /* Error */ {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.transformed.expect
index 6018765..a968e71 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.strong.transformed.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// var a = switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// var a = switch (x2) /* Error */ {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.expect
index 96178e5..fee7022 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// var a = switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// var a = switch (x2) /* Error */ {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.modular.expect
index 96178e5..fee7022 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.modular.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// var a = switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// var a = switch (x2) /* Error */ {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.transformed.expect
index 96178e5..fee7022 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart.weak.transformed.expect
@@ -2,43 +2,43 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:28:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:32:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:49:11: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:53:18: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// return switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:90:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
// Try adding a default case or cases that match 'false'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'false'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:96:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'false'.
+// Try adding a wildcard pattern or cases that match 'false'.
// var a = switch (x2) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:118:13: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
// Try adding a default case or cases that match 'true'.
// switch (x1) /* Error */ {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'true'.
+// pkg/front_end/testcases/patterns/exhaustiveness/intersect.dart:124:21: Error: The type 'T' is not exhaustively matched by the switch cases since it doesn't match 'true'.
+// Try adding a wildcard pattern or cases that match 'true'.
// var a = switch (x2) /* Error */ {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect
index 3e2b42a..00739d1 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect
@@ -2,99 +2,99 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2cMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...]]'.
+// Try adding a wildcard pattern or cases that match '[...]'.
// nonExhaustiveRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), ...]'.
// nonExhaustive1aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double()]'.
+// Try adding a wildcard pattern or cases that match '[double()]'.
// nonExhaustive2aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2cRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), _, ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), _, ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), _, ...]'.
// nonExhaustive2dRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2eRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2fRestrictedValue(List<num> list) => switch (list) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect
index f4e8e83..056820e 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect
@@ -2,99 +2,99 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2cMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...]]'.
+// Try adding a wildcard pattern or cases that match '[...]'.
// nonExhaustiveRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), ...]'.
// nonExhaustive1aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double()]'.
+// Try adding a wildcard pattern or cases that match '[double()]'.
// nonExhaustive2aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2cRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), _, ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), _, ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), _, ...]'.
// nonExhaustive2dRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2eRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2fRestrictedValue(List<num> list) => switch (list) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect
index 7c9519a..ad9967c 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect
@@ -2,99 +2,99 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2cMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...]]'.
+// Try adding a wildcard pattern or cases that match '[...]'.
// nonExhaustiveRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), ...]'.
// nonExhaustive1aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double()]'.
+// Try adding a wildcard pattern or cases that match '[double()]'.
// nonExhaustive2aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2cRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), _, ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), _, ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), _, ...]'.
// nonExhaustive2dRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2eRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2fRestrictedValue(List<num> list) => switch (list) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect
index 7c9519a..ad9967c 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect
@@ -2,99 +2,99 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2cMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...]]'.
+// Try adding a wildcard pattern or cases that match '[...]'.
// nonExhaustiveRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), ...]'.
// nonExhaustive1aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double()]'.
+// Try adding a wildcard pattern or cases that match '[double()]'.
// nonExhaustive2aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2cRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), _, ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), _, ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), _, ...]'.
// nonExhaustive2dRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2eRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2fRestrictedValue(List<num> list) => switch (list) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect
index c252a6f..b945214 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect
@@ -2,99 +2,99 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:37:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:41:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:45:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2aMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:50:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2bMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:55:51: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_]'.
+// Try adding a wildcard pattern or cases that match '[_]'.
// nonExhaustive2cMissing(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:60:56: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...]]'.
+// Try adding a wildcard pattern or cases that match '[...]'.
// nonExhaustiveRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:64:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), ...]'.
// nonExhaustive1aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:69:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[]'.
+// Try adding a wildcard pattern or cases that match '[]'.
// nonExhaustive1aRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:74:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:79:58: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[...[...], double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[...[...], double()]'.
+// Try adding a wildcard pattern or cases that match '[..., double()]'.
// nonExhaustive1bRestrictedType(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:84:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double()]'.
+// Try adding a wildcard pattern or cases that match '[double()]'.
// nonExhaustive2aRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:90:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2bRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:96:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), double(), ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), double(), ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), double(), ...]'.
// nonExhaustive2cRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:102:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[double(), _, ...[...]]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[double(), _, ...[...]]'.
+// Try adding a wildcard pattern or cases that match '[double(), _, ...]'.
// nonExhaustive2dRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:108:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2eRestrictedValue(List<num> list) => switch (list) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/list.dart:114:59: Error: The type 'List<num>' is not exhaustively matched by the switch cases since it doesn't match '[_, double()]'.
// - 'List' is from 'dart:core'.
-// Try adding a default case or cases that match '[_, double()]'.
+// Try adding a wildcard pattern or cases that match '[_, double()]'.
// nonExhaustive2fRestrictedValue(List<num> list) => switch (list) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.expect
index e143998..2d17d969 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.expect
@@ -2,20 +2,20 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Null(hashCode: int())'.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases since it doesn't match 'Null(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveRestrictedField(Null n) => switch (n) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'null'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveNullable(Object? o) => switch (o) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'Object(hashCode: int())'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'Object(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// nonExhaustiveNullableRestricted(Object? o) => switch (o) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.transformed.expect
index 4504753..fede6dd 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.strong.transformed.expect
@@ -2,20 +2,20 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Null(hashCode: int())'.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases since it doesn't match 'Null(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveRestrictedField(Null n) => switch (n) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'null'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveNullable(Object? o) => switch (o) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'Object(hashCode: int())'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'Object(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// nonExhaustiveNullableRestricted(Object? o) => switch (o) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.expect
index dcb6786..7842652 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.expect
@@ -2,20 +2,20 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Null(hashCode: int())'.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases since it doesn't match 'Null(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveRestrictedField(Null n) => switch (n) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'null'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveNullable(Object? o) => switch (o) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'Object(hashCode: int())'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'Object(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// nonExhaustiveNullableRestricted(Object? o) => switch (o) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.modular.expect
index dcb6786..7842652 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.modular.expect
@@ -2,20 +2,20 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Null(hashCode: int())'.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases since it doesn't match 'Null(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveRestrictedField(Null n) => switch (n) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'null'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveNullable(Object? o) => switch (o) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'Object(hashCode: int())'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'Object(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// nonExhaustiveNullableRestricted(Object? o) => switch (o) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.transformed.expect
index 12ff3f0..bc59ad1 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/null.dart.weak.transformed.expect
@@ -2,20 +2,20 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Null(hashCode: int())'.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:19:49: Error: The type 'Null' is not exhaustively matched by the switch cases since it doesn't match 'Null(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveRestrictedField(Null n) => switch (n) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:28:45: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'null'.
+// Try adding a wildcard pattern or cases that match 'null'.
// nonExhaustiveNullable(Object? o) => switch (o) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/null.dart:32:55: Error: The type 'Object?' is not exhaustively matched by the switch cases since it doesn't match 'Object(hashCode: int())'.
// - 'Object' is from 'dart:core'.
-// Try adding a default case or cases that match 'Object(hashCode: int())'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// nonExhaustiveNullableRestricted(Object? o) => switch (o) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.expect
index 41e6c84..10bcba0 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.expect
@@ -2,15 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field1: int())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field1: int())'.
+// Try adding a wildcard pattern or cases that match 'A()'.
// nonExhaustiveFixedField(A a) => switch (a) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field2: double())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field2: double())'.
+// Try adding a wildcard pattern or cases that match 'A(field2: double())'.
// nonExhaustiveTypedField(A a) => switch (a) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.transformed.expect
index d7557a8..2cecff7 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.strong.transformed.expect
@@ -2,15 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field1: int())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field1: int())'.
+// Try adding a wildcard pattern or cases that match 'A()'.
// nonExhaustiveFixedField(A a) => switch (a) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field2: double())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field2: double())'.
+// Try adding a wildcard pattern or cases that match 'A(field2: double())'.
// nonExhaustiveTypedField(A a) => switch (a) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.expect
index 6a48f08..7dff491 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.expect
@@ -2,15 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field1: int())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field1: int())'.
+// Try adding a wildcard pattern or cases that match 'A()'.
// nonExhaustiveFixedField(A a) => switch (a) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field2: double())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field2: double())'.
+// Try adding a wildcard pattern or cases that match 'A(field2: double())'.
// nonExhaustiveTypedField(A a) => switch (a) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.modular.expect
index 6a48f08..7dff491 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.modular.expect
@@ -2,15 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field1: int())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field1: int())'.
+// Try adding a wildcard pattern or cases that match 'A()'.
// nonExhaustiveFixedField(A a) => switch (a) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field2: double())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field2: double())'.
+// Try adding a wildcard pattern or cases that match 'A(field2: double())'.
// nonExhaustiveTypedField(A a) => switch (a) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.transformed.expect
index fe5d645..b8ee932 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart.weak.transformed.expect
@@ -2,15 +2,15 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:28:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field1: int())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field1: int())'.
+// Try adding a wildcard pattern or cases that match 'A()'.
// nonExhaustiveFixedField(A a) => switch (a) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases.
+// pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart:32:41: Error: The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'A(field2: double())'.
// - 'A' is from 'pkg/front_end/testcases/patterns/exhaustiveness/object_pattern.dart'.
-// Try adding a default case or cases that match 'A(field2: double())'.
+// Try adding a wildcard pattern or cases that match 'A(field2: double())'.
// nonExhaustiveTypedField(A a) => switch (a) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.expect
index 81ba884..5c215a4 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.expect
@@ -2,18 +2,18 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue1((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue2((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: false)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: false)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: false)'.
// nonExhaustiveRestrictedValue3((int, String, {bool named}) r) => switch (r) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.transformed.expect
index dafaf1d..c660e2e 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.strong.transformed.expect
@@ -2,18 +2,18 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue1((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue2((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: false)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: false)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: false)'.
// nonExhaustiveRestrictedValue3((int, String, {bool named}) r) => switch (r) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.expect
index 95f4d83..bd709e6 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.expect
@@ -2,18 +2,18 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue1((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue2((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: false)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: false)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: false)'.
// nonExhaustiveRestrictedValue3((int, String, {bool named}) r) => switch (r) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.modular.expect
index 95f4d83..bd709e6 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.modular.expect
@@ -2,18 +2,18 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue1((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue2((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: false)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: false)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: false)'.
// nonExhaustiveRestrictedValue3((int, String, {bool named}) r) => switch (r) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.transformed.expect
index 8cde10c..584cf3e 100644
--- a/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/exhaustiveness/record.dart.weak.transformed.expect
@@ -2,18 +2,18 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue1((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: true)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: true)'.
// nonExhaustiveRestrictedValue2((int, String, {bool named}) r) => switch (r) {
// ^
//
-// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match '(int(), String(), named: false)'.
+// pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: false)'.
+// Try adding a wildcard pattern or cases that match '(_, _, named: false)'.
// nonExhaustiveRestrictedValue3((int, String, {bool named}) r) => switch (r) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.expect b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.expect
index 490df10..c022675 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {};
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.transformed.expect
index 490df10..c022675 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {};
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.expect b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.expect
index b2eb3d0..1bea111 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {};
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.modular.expect
index b2eb3d0..1bea111 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.modular.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {};
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.transformed.expect
index b2eb3d0..1bea111 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_empty.dart.weak.transformed.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {};
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.expect b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.expect
index 825fc6a..6600671 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.transformed.expect
index 874313b..4d001c9 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.expect b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.expect
index de72e05..cb6b8f0 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.modular.expect
index de72e05..cb6b8f0 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.modular.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.modular.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {
// ^
//
diff --git a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.transformed.expect
index cbfffe9..e2488e2 100644
--- a/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart.weak.transformed.expect
@@ -2,8 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases.
-// Try adding a default case or cases that match 'Object()'.
+// pkg/front_end/testcases/patterns/switchExpression_onePattern_guarded.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
+// Try adding a wildcard pattern or cases that match 'Object()'.
// f(x) => switch(x) {
// ^
//
diff --git a/tests/language/patterns/exhaustiveness/bool_switch_test.dart b/tests/language/patterns/exhaustiveness/bool_switch_test.dart
index cee8192..4b01bda 100644
--- a/tests/language/patterns/exhaustiveness/bool_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/bool_switch_test.dart
@@ -46,9 +46,9 @@
void nonExhaustiveSwitch1(bool b) {
switch (b) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'bool' is not exhaustively matched by the switch cases.
+// [cfe] The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'false'.
case true:
print('true');
break;
@@ -58,9 +58,9 @@
void nonExhaustiveSwitch2(bool b) {
switch (b) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'bool' is not exhaustively matched by the switch cases.
+// [cfe] The type 'bool' is not exhaustively matched by the switch cases since it doesn't match 'true'.
case false:
print('false');
break;
@@ -95,9 +95,9 @@
void nonExhaustiveNullableSwitch1(bool? b) {
switch (b) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'bool?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case true:
print('true');
break;
@@ -110,9 +110,9 @@
void nonExhaustiveNullableSwitch2(bool? b) {
switch (b) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'bool?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'bool?' is not exhaustively matched by the switch cases since it doesn't match 'false'.
case true:
print('true');
break;
diff --git a/tests/language/patterns/exhaustiveness/enum_switch_test.dart b/tests/language/patterns/exhaustiveness/enum_switch_test.dart
index 4322717..a7c7f96 100644
--- a/tests/language/patterns/exhaustiveness/enum_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/enum_switch_test.dart
@@ -59,9 +59,9 @@
void nonExhaustiveSwitch1(Enum e) {
switch (e) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
case Enum.a:
print('a');
break;
@@ -74,9 +74,9 @@
void nonExhaustiveSwitch2(Enum e) {
switch (e) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
case Enum.a:
print('a');
break;
@@ -89,9 +89,9 @@
void nonExhaustiveSwitch3(Enum e) {
switch (e) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
case Enum.b:
print('b');
break;
@@ -104,9 +104,9 @@
void nonExhaustiveSwitch4(Enum e) {
switch (e) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.a'.
case Enum.b:
print('b');
break;
@@ -144,9 +144,9 @@
void nonExhaustiveNullableSwitch1(Enum? e) {
switch (e) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case Enum.a:
print('a');
break;
@@ -162,9 +162,9 @@
void nonExhaustiveNullableSwitch2(Enum? e) {
switch (e) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum?' is not exhaustively matched by the switch cases since it doesn't match 'Enum.b'.
case Enum.a:
print('a');
break;
@@ -199,9 +199,9 @@
void unreachableCase2(Enum e) {
switch (e) /* Non-exhaustive */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'Enum' is not exhaustively matched by the switch cases.
+// [cfe] The type 'Enum' is not exhaustively matched by the switch cases since it doesn't match 'Enum.c'.
case Enum.a:
print('a1');
break;
diff --git a/tests/language/patterns/exhaustiveness/fallback_error_test.dart b/tests/language/patterns/exhaustiveness/fallback_error_test.dart
index b81c9c0..b38ce2a 100644
--- a/tests/language/patterns/exhaustiveness/fallback_error_test.dart
+++ b/tests/language/patterns/exhaustiveness/fallback_error_test.dart
@@ -254,9 +254,9 @@
// call is on the expression which we do not control.
switch (e) {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'E' is not exhaustively matched by the switch cases.
+// [cfe] The type 'E' is not exhaustively matched by the switch cases since it doesn't match 'E.e1'.
case == E.e1:
break;
case == E.e2:
@@ -264,9 +264,9 @@
}
ignore(switch (e) {
// ^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+ // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_EXPRESSION
// ^
- // [cfe] The type 'E' is not exhaustively matched by the switch cases.
+ // [cfe] The type 'E' is not exhaustively matched by the switch cases since it doesn't match 'E.e1'.
== E.e1 => 0,
== E.e2 => 1
});
@@ -279,9 +279,9 @@
// The real exhaustiveness handles this.
switch (e) {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'E' is not exhaustively matched by the switch cases.
+// [cfe] The type 'E' is not exhaustively matched by the switch cases since it doesn't match 'E.e1'.
case E.e1 when true:
break;
case E.e2:
@@ -289,9 +289,9 @@
}
ignore(switch (e) {
// ^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+ // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_EXPRESSION
// ^
- // [cfe] The type 'E' is not exhaustively matched by the switch cases.
+ // [cfe] The type 'E' is not exhaustively matched by the switch cases since it doesn't match 'E.e1'.
E.e1 when true => 0,
E.e2 => 1
});
diff --git a/tests/language/patterns/exhaustiveness/list_constant_test.dart b/tests/language/patterns/exhaustiveness/list_constant_test.dart
index 06c51ce..46d8f02 100644
--- a/tests/language/patterns/exhaustiveness/list_constant_test.dart
+++ b/tests/language/patterns/exhaustiveness/list_constant_test.dart
@@ -10,9 +10,9 @@
void main() {
var result = switch ([1, 2, 3]) {
// ^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+ // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_EXPRESSION
// ^
- // [cfe] The type 'List<int>' is not exhaustively matched by the switch cases.
+ // [cfe] The type 'List<int>' is not exhaustively matched by the switch cases since it doesn't match '[]'.
const [] => 'empty constant',
[_, ...] => 'non-empty'
};
diff --git a/tests/language/patterns/exhaustiveness/null_type_test.dart b/tests/language/patterns/exhaustiveness/null_type_test.dart
index ae5ace3..9e30119 100644
--- a/tests/language/patterns/exhaustiveness/null_type_test.dart
+++ b/tests/language/patterns/exhaustiveness/null_type_test.dart
@@ -41,9 +41,9 @@
// Must cover null somehow.
result = switch (maybeInt) {
// ^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+ // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_EXPRESSION
// ^
- // [cfe] The type 'int?' is not exhaustively matched by the switch cases.
+ // [cfe] The type 'int?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
int _ => 'int',
};
}
diff --git a/tests/language/patterns/exhaustiveness/object_pattern_switch_test.dart b/tests/language/patterns/exhaustiveness/object_pattern_switch_test.dart
index 73dc9e5..1963647 100644
--- a/tests/language/patterns/exhaustiveness/object_pattern_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/object_pattern_switch_test.dart
@@ -37,9 +37,9 @@
void nonExhaustiveSwitch1(A r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'B(a: Enum.b, b: false)'.
case A(a: Enum.a, b: false):
print('A(a, false)');
break;
@@ -55,9 +55,9 @@
void nonExhaustiveSwitch2(A r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'B(a: Enum.a, b: false)'.
case A(a: Enum.b, b: false):
print('A(b, false)');
break;
@@ -104,9 +104,9 @@
void nonExhaustiveNullableSwitch1(A? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case A(a: Enum.a, b: false):
print('A(a, false)');
break;
@@ -125,9 +125,9 @@
void nonExhaustiveNullableSwitch2(A? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'B(a: Enum.b, b: false)'.
case A(a: Enum.a, b: false):
print('A(a, false)');
break;
diff --git a/tests/language/patterns/exhaustiveness/record_literal_named_switch_test.dart b/tests/language/patterns/exhaustiveness/record_literal_named_switch_test.dart
index 9e9baba..f3d731e 100644
--- a/tests/language/patterns/exhaustiveness/record_literal_named_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/record_literal_named_switch_test.dart
@@ -26,9 +26,9 @@
void nonExhaustiveSwitch1(({Enum a, bool b}) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '({Enum a, bool b})' is not exhaustively matched by the switch cases.
+// [cfe] The type '({Enum a, bool b})' is not exhaustively matched by the switch cases since it doesn't match '(a: Enum.b, b: false)'.
case (a: Enum.a, b: false):
print('(a, false)');
break;
@@ -44,9 +44,9 @@
void nonExhaustiveSwitch2(({Enum a, bool b}) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '({Enum a, bool b})' is not exhaustively matched by the switch cases.
+// [cfe] The type '({Enum a, bool b})' is not exhaustively matched by the switch cases since it doesn't match '(a: Enum.a, b: false)'.
case (a: Enum.b, b: false):
print('(b, false)');
break;
@@ -93,9 +93,9 @@
void nonExhaustiveNullableSwitch1(({Enum a, bool b})? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '({Enum a, bool b})?' is not exhaustively matched by the switch cases.
+// [cfe] The type '({Enum a, bool b})?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case (a: Enum.a, b: false):
print('(a, false)');
break;
@@ -114,9 +114,9 @@
void nonExhaustiveNullableSwitch2(({Enum a, bool b})? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '({Enum a, bool b})?' is not exhaustively matched by the switch cases.
+// [cfe] The type '({Enum a, bool b})?' is not exhaustively matched by the switch cases since it doesn't match '(a: Enum.b, b: false)'.
case (a: Enum.a, b: false):
print('(a, false)');
break;
diff --git a/tests/language/patterns/exhaustiveness/record_literal_switch_test.dart b/tests/language/patterns/exhaustiveness/record_literal_switch_test.dart
index ce0a27d..3db76f2 100644
--- a/tests/language/patterns/exhaustiveness/record_literal_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/record_literal_switch_test.dart
@@ -26,9 +26,9 @@
void nonExhaustiveSwitch1((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, false)'.
case (Enum.a, false):
print('(a, false)');
break;
@@ -44,9 +44,9 @@
void nonExhaustiveSwitch2((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.a, false)'.
case (Enum.b, false):
print('(b, false)');
break;
@@ -93,9 +93,9 @@
void nonExhaustiveNullableSwitch1((Enum, bool)? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case (Enum.a, false):
print('(a, false)');
break;
@@ -114,9 +114,9 @@
void nonExhaustiveNullableSwitch2((Enum, bool)? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, false)'.
case (Enum.a, false):
print('(a, false)');
break;
diff --git a/tests/language/patterns/exhaustiveness/record_switch_test.dart b/tests/language/patterns/exhaustiveness/record_switch_test.dart
index cab6a4c..d40c955 100644
--- a/tests/language/patterns/exhaustiveness/record_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/record_switch_test.dart
@@ -30,9 +30,9 @@
void nonExhaustiveSwitch1((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, false)'.
case r0:
print('(a, false)');
break;
@@ -48,9 +48,9 @@
void nonExhaustiveSwitch2((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.a, false)'.
case r1:
print('(b, false)');
break;
@@ -97,9 +97,9 @@
void nonExhaustiveNullableSwitch1((Enum, bool)? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case r0:
print('(a, false)');
break;
@@ -118,9 +118,9 @@
void nonExhaustiveNullableSwitch2((Enum, bool)? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, false)'.
case r0:
print('(a, false)');
break;
diff --git a/tests/language/patterns/exhaustiveness/sealed_class_switch_test.dart b/tests/language/patterns/exhaustiveness/sealed_class_switch_test.dart
index 0487821..7e345c2 100644
--- a/tests/language/patterns/exhaustiveness/sealed_class_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/sealed_class_switch_test.dart
@@ -39,9 +39,9 @@
void nonExhaustiveSwitch1(A a) {
switch (a) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'D()'.
case B b:
print('B');
break;
@@ -54,9 +54,9 @@
void nonExhaustiveSwitch2(A a) {
switch (a) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'B()'.
case C c:
print('C');
break;
@@ -69,9 +69,9 @@
void nonExhaustiveSwitch3(A a) {
switch (a) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'C()'.
case B b:
print('B');
break;
@@ -112,9 +112,9 @@
void nonExhaustiveNullableSwitch1(A? a) {
switch (a) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case A a:
print('A');
break;
@@ -124,9 +124,9 @@
void nonExhaustiveNullableSwitch2(A? a) {
switch (a) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A?' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A?' is not exhaustively matched by the switch cases since it doesn't match 'D()'.
case B b:
print('B');
break;
diff --git a/tests/language/patterns/exhaustiveness/shared_sealed_supertypes_test.dart b/tests/language/patterns/exhaustiveness/shared_sealed_supertypes_test.dart
index 069b43d..4eaca99 100644
--- a/tests/language/patterns/exhaustiveness/shared_sealed_supertypes_test.dart
+++ b/tests/language/patterns/exhaustiveness/shared_sealed_supertypes_test.dart
@@ -69,9 +69,9 @@
// Missing leaf.
switch (a) {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'D()'.
case E _:
print('E');
case F _:
@@ -80,9 +80,9 @@
switch (a) {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'E()'.
case D _:
print('D');
case F _:
@@ -91,9 +91,9 @@
switch (a) {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type 'A' is not exhaustively matched by the switch cases.
+// [cfe] The type 'A' is not exhaustively matched by the switch cases since it doesn't match 'F()'.
case D _:
print('D');
case E _:
diff --git a/tests/language/patterns/exhaustiveness/variable_pattern_switch_test.dart b/tests/language/patterns/exhaustiveness/variable_pattern_switch_test.dart
index e62ca2d..a948058 100644
--- a/tests/language/patterns/exhaustiveness/variable_pattern_switch_test.dart
+++ b/tests/language/patterns/exhaustiveness/variable_pattern_switch_test.dart
@@ -31,9 +31,9 @@
void nonExhaustiveSwitch1((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, false)'.
case (Enum.a, var b):
print('(a, *)');
break;
@@ -46,9 +46,9 @@
void nonExhaustiveSwitch2((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, true)'.
case (var a, false):
print('(*, false)');
break;
@@ -61,9 +61,9 @@
void nonExhaustiveSwitch3((Enum, bool) r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)' is not exhaustively matched by the switch cases since it doesn't match '(Enum.b, true)'.
case (Enum a, false):
print('(*, false)');
break;
@@ -101,9 +101,9 @@
void nonExhaustiveNullableSwitch1((Enum, bool)? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases since it doesn't match 'null'.
case (Enum a, bool b):
print('(*, *)');
break;
@@ -113,9 +113,9 @@
void nonExhaustiveNullableSwitch2((Enum, bool)? r) {
switch (r) /* Error */ {
//^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+// [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_STATEMENT
// ^
-// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases.
+// [cfe] The type '(Enum, bool)?' is not exhaustively matched by the switch cases since it doesn't match '(Enum.a, true)'.
case (Enum a, false):
print('(*, false)');
break;
diff --git a/tests/language/patterns/int_to_double_error_test.dart b/tests/language/patterns/int_to_double_error_test.dart
index d3840ac..9a90d2d 100644
--- a/tests/language/patterns/int_to_double_error_test.dart
+++ b/tests/language/patterns/int_to_double_error_test.dart
@@ -25,9 +25,9 @@
// Non-exhaustive since double case doesn't cover uncoerced int type.
var result = switch (123) {
// ^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH
+ // [analyzer] COMPILE_TIME_ERROR.NON_EXHAUSTIVE_SWITCH_EXPRESSION
// ^
- // [cfe] The type 'int' is not exhaustively matched by the switch cases.
+ // [cfe] The type 'int' is not exhaustively matched by the switch cases since it doesn't match 'int()'.
double d => 'wrong'
};
}