Skip to content

Commit cfe9932

Browse files
chloestefantsovaCommit Queue
authored and
Commit Queue
committed
[cfe] Make pattern matching error a StateError
This is the first step in adjusting the runtime error raised on a pattern mismatch in an irrefutable context. For now, the error message isn't specialized and doesn't reflect the nature of the mismatch. Part of #51720 Part of #49749 Change-Id: Ie4b997a1a36e92b25f1372f4dd98941dbcc08b61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290842 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Chloe Stefantsova <[email protected]>
1 parent 82a60e8 commit cfe9932

File tree

210 files changed

+446
-586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+446
-586
lines changed

pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10920,6 +10920,14 @@ const MessageCode messagePatternAssignmentNotLocalVariable = const MessageCode(
1092010920
r"""Only local variables or formal parameters can be used in pattern assignments.""",
1092110921
correctionMessage: r"""Try assigning to a local variable.""");
1092210922

10923+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
10924+
const Code<Null> codePatternMatchingError = messagePatternMatchingError;
10925+
10926+
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
10927+
const MessageCode messagePatternMatchingError = const MessageCode(
10928+
"PatternMatchingError",
10929+
problemMessage: r"""Pattern matching error""");
10930+
1092310931
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
1092410932
const Code<Null> codePlatformPrivateLibraryAccess =
1092510933
messagePlatformPrivateLibraryAccess;

pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,8 +1665,11 @@ class ConstantsTransformer extends RemovingTransformer {
16651665
createIfStatement(
16661666
createNot(readMatchingExpression),
16671667
createExpressionStatement(createThrow(createConstructorInvocation(
1668-
typeEnvironment.coreTypes.reachabilityErrorConstructor,
1669-
createArguments([], fileOffset: node.fileOffset),
1668+
typeEnvironment.coreTypes.stateErrorConstructor,
1669+
createArguments([
1670+
createStringLiteral(messagePatternMatchingError.problemMessage,
1671+
fileOffset: node.fileOffset)
1672+
], fileOffset: node.fileOffset),
16701673
fileOffset: node.fileOffset))),
16711674
fileOffset: node.fileOffset),
16721675
];

pkg/front_end/messages.status

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ PatchInjectionFailed/example: Fail
848848
PatchNonExternal/analyzerCode: Fail
849849
PatchNonExternal/example: Fail
850850
PatternAssignmentDeclaresVariable/analyzerCode: Fail
851+
PatternMatchingError/analyzerCode: Fail
852+
PatternMatchingError/example: Fail
851853
PlatformPrivateLibraryAccess/example: Fail
852854
PositionalAfterNamedArgument/example: Fail
853855
PositionalSuperParametersAndArguments/analyzerCode: Fail
@@ -974,12 +976,12 @@ UnmatchedToken/part_wrapped_script3: Fail
974976
UnmatchedToken/script1: Fail
975977
UnmatchedToken/script3: Fail
976978
UnnamedObjectPatternField/analyzerCode: Fail
979+
UnreachableSwitchCase/part_wrapped_script: Fail # https://github.com/dart-lang/language/issues/2924
980+
UnreachableSwitchCase/script: Fail # https://github.com/dart-lang/language/issues/2924
977981
Unspecified/analyzerCode: Fail
978982
Unspecified/example: Fail
979983
UnsupportedDartExt/analyzerCode: Fail
980984
UnsupportedDartExt/part_wrapped_script: Fail # Example uses import declaration.
981-
UnreachableSwitchCase/part_wrapped_script: Fail # https://github.com/dart-lang/language/issues/2924
982-
UnreachableSwitchCase/script: Fail # https://github.com/dart-lang/language/issues/2924
983985
UnterminatedString/part_wrapped_script2: Fail
984986
UnterminatedString/part_wrapped_script4: Fail
985987
UnterminatedString/part_wrapped_script5: Fail
@@ -1003,20 +1005,20 @@ VarAsTypeName/script1: Fail # Too many problems
10031005
VariableCouldBeNullDueToWrite/analyzerCode: Fail
10041006
VariableCouldBeNullDueToWrite/example: Fail
10051007
VariablePatternTypeMismatchInSwitchHeads/analyzerCode: Fail
1006-
WeakWithStrongDillLibrary/analyzerCode: Fail
1007-
WeakWithStrongDillLibrary/example: Fail
1008-
WeakReferenceNotStatic/analyzerCode: Fail
1009-
WeakReferenceNotStatic/example: Fail
1008+
WeakReferenceMismatchReturnAndArgumentTypes/analyzerCode: Fail
1009+
WeakReferenceMismatchReturnAndArgumentTypes/example: Fail
10101010
WeakReferenceNotOneArgument/analyzerCode: Fail
10111011
WeakReferenceNotOneArgument/example: Fail
1012+
WeakReferenceNotStatic/analyzerCode: Fail
1013+
WeakReferenceNotStatic/example: Fail
10121014
WeakReferenceReturnTypeNotNullable/analyzerCode: Fail
10131015
WeakReferenceReturnTypeNotNullable/example: Fail
1014-
WeakReferenceMismatchReturnAndArgumentTypes/analyzerCode: Fail
1015-
WeakReferenceMismatchReturnAndArgumentTypes/example: Fail
1016-
WeakReferenceTargetNotStaticTearoff/analyzerCode: Fail
1017-
WeakReferenceTargetNotStaticTearoff/example: Fail
10181016
WeakReferenceTargetHasParameters/analyzerCode: Fail
10191017
WeakReferenceTargetHasParameters/example: Fail
1018+
WeakReferenceTargetNotStaticTearoff/analyzerCode: Fail
1019+
WeakReferenceTargetNotStaticTearoff/example: Fail
1020+
WeakWithStrongDillLibrary/analyzerCode: Fail
1021+
WeakWithStrongDillLibrary/example: Fail
10201022
WebLiteralCannotBeRepresentedExactly/analyzerCode: Fail
10211023
WebLiteralCannotBeRepresentedExactly/example: Fail
10221024
YieldAsIdentifier/example: Fail

pkg/front_end/messages.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6712,3 +6712,6 @@ EqualKeysInMapPattern:
67126712
EqualKeysInMapPatternContext:
67136713
problemMessage: This is the previous use of the same key.
67146714
severity: CONTEXT
6715+
6716+
PatternMatchingError:
6717+
problemMessage: "Pattern matching error"

pkg/front_end/testcases/patterns/collections_entry_to_element_conversion_in_inference.dart.strong.expect

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/;
22
import self as self;
33
import "dart:core" as core;
44
import "dart:collection" as col;
5-
import "dart:_internal" as _in;
65

76
static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
87
return block {
@@ -14,7 +13,7 @@ static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
1413
late final synthesized dynamic #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic};
1514
late final synthesized dynamic #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic};
1615
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (#0#6 is{ForNonNullableByDefault} core::int && (let final dynamic #t2 = i = #0#6{core::int} in true)) && (#0#7 is{ForNonNullableByDefault} core::int && (let final dynamic #t3 = n = #0#7{core::int} in true))))
17-
throw new _in::ReachabilityError::•();
16+
throw new core::StateError::•("Pattern matching error");
1817
}
1918
final core::int #t4 = i;
2019
final core::int #t5 = n;
@@ -45,7 +44,7 @@ static method test3(dynamic x, dynamic another) → core::Iterable<dynamic> {
4544
{
4645
final synthesized dynamic #0#0 = #t12;
4746
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C2 && #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} is{ForNonNullableByDefault} core::int))
48-
throw new _in::ReachabilityError::•();
47+
throw new core::StateError::•("Pattern matching error");
4948
}
5049
for (final has-declared-initializer dynamic #t13 in another as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
5150
final dynamic #t14 = #t13 as{TypeError,ForNonNullableByDefault} dynamic;

pkg/front_end/testcases/patterns/collections_entry_to_element_conversion_in_inference.dart.strong.transformed.expect

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/;
22
import self as self;
33
import "dart:core" as core;
44
import "dart:collection" as col;
5-
import "dart:_internal" as _in;
65

76
static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
87
return block {
@@ -18,7 +17,7 @@ static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
1817
return #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic};
1918
late final synthesized dynamic #0#7 = ##0#7#initializer(){() → dynamic};
2019
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (#0#6 is{ForNonNullableByDefault} core::int && (let final core::int #t2 = i = #0#6{core::int} in true)) && (#0#7 is{ForNonNullableByDefault} core::int && (let final core::int #t3 = n = #0#7{core::int} in true))))
21-
throw new _in::ReachabilityError::•();
20+
throw new core::StateError::•("Pattern matching error");
2221
}
2322
final core::int #t4 = i;
2423
final core::int #t5 = n;
@@ -63,7 +62,7 @@ static method test3(dynamic x, dynamic another) → core::Iterable<dynamic> {
6362
{
6463
final synthesized dynamic #0#0 = #t12;
6564
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C2 && #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} is{ForNonNullableByDefault} core::int))
66-
throw new _in::ReachabilityError::•();
65+
throw new core::StateError::•("Pattern matching error");
6766
}
6867
{
6968
synthesized core::Iterator<dynamic> :sync-for-iterator = (another as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>).{core::Iterable::iterator}{core::Iterator<dynamic>};

pkg/front_end/testcases/patterns/collections_entry_to_element_conversion_in_inference.dart.weak.expect

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/;
22
import self as self;
33
import "dart:core" as core;
44
import "dart:collection" as col;
5-
import "dart:_internal" as _in;
65

76
static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
87
return block {
@@ -14,7 +13,7 @@ static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
1413
late final synthesized dynamic #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic};
1514
late final synthesized dynamic #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic};
1615
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (#0#6 is{ForNonNullableByDefault} core::int && (let final dynamic #t2 = i = #0#6{core::int} in true)) && (#0#7 is{ForNonNullableByDefault} core::int && (let final dynamic #t3 = n = #0#7{core::int} in true))))
17-
throw new _in::ReachabilityError::•();
16+
throw new core::StateError::•("Pattern matching error");
1817
}
1918
final core::int #t4 = i;
2019
final core::int #t5 = n;
@@ -45,7 +44,7 @@ static method test3(dynamic x, dynamic another) → core::Iterable<dynamic> {
4544
{
4645
final synthesized dynamic #0#0 = #t12;
4746
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C2 && #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} is{ForNonNullableByDefault} core::int))
48-
throw new _in::ReachabilityError::•();
47+
throw new core::StateError::•("Pattern matching error");
4948
}
5049
for (final has-declared-initializer dynamic #t13 in another as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
5150
final dynamic #t14 = #t13 as{TypeError,ForNonNullableByDefault} dynamic;

pkg/front_end/testcases/patterns/collections_entry_to_element_conversion_in_inference.dart.weak.modular.expect

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/;
22
import self as self;
33
import "dart:core" as core;
44
import "dart:collection" as col;
5-
import "dart:_internal" as _in;
65

76
static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
87
return block {
@@ -14,7 +13,7 @@ static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
1413
late final synthesized dynamic #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic};
1514
late final synthesized dynamic #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic};
1615
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (#0#6 is{ForNonNullableByDefault} core::int && (let final dynamic #t2 = i = #0#6{core::int} in true)) && (#0#7 is{ForNonNullableByDefault} core::int && (let final dynamic #t3 = n = #0#7{core::int} in true))))
17-
throw new _in::ReachabilityError::•();
16+
throw new core::StateError::•("Pattern matching error");
1817
}
1918
final core::int #t4 = i;
2019
final core::int #t5 = n;
@@ -45,7 +44,7 @@ static method test3(dynamic x, dynamic another) → core::Iterable<dynamic> {
4544
{
4645
final synthesized dynamic #0#0 = #t12;
4746
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C2 && #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} is{ForNonNullableByDefault} core::int))
48-
throw new _in::ReachabilityError::•();
47+
throw new core::StateError::•("Pattern matching error");
4948
}
5049
for (final has-declared-initializer dynamic #t13 in another as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
5150
final dynamic #t14 = #t13 as{TypeError,ForNonNullableByDefault} dynamic;

pkg/front_end/testcases/patterns/collections_entry_to_element_conversion_in_inference.dart.weak.transformed.expect

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ library /*isNonNullableByDefault*/;
22
import self as self;
33
import "dart:core" as core;
44
import "dart:collection" as col;
5-
import "dart:_internal" as _in;
65

76
static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
87
return block {
@@ -18,7 +17,7 @@ static method test1(dynamic x, dynamic another) → core::Iterable<dynamic> {
1817
return #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic};
1918
late final synthesized dynamic #0#7 = ##0#7#initializer(){() → dynamic};
2019
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (#0#6 is{ForNonNullableByDefault} core::int && (let final core::int #t2 = i = #0#6{core::int} in true)) && (#0#7 is{ForNonNullableByDefault} core::int && (let final core::int #t3 = n = #0#7{core::int} in true))))
21-
throw new _in::ReachabilityError::•();
20+
throw new core::StateError::•("Pattern matching error");
2221
}
2322
final core::int #t4 = i;
2423
final core::int #t5 = n;
@@ -63,7 +62,7 @@ static method test3(dynamic x, dynamic another) → core::Iterable<dynamic> {
6362
{
6463
final synthesized dynamic #0#0 = #t12;
6564
if(!(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C2 && #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} is{ForNonNullableByDefault} core::int))
66-
throw new _in::ReachabilityError::•();
65+
throw new core::StateError::•("Pattern matching error");
6766
}
6867
{
6968
synthesized core::Iterator<dynamic> :sync-for-iterator = (another as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>).{core::Iterable::iterator}{core::Iterator<dynamic>};

pkg/front_end/testcases/patterns/dynamic_guard.dart.strong.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static method main() → dynamic {
1010
{
1111
final synthesized dynamic #0#0 = <core::int>[5];
1212
if(!(#0#0{core::List<core::int>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (let final dynamic #t1 = a = #0#0{core::List<core::int>}.{core::List::[]}(0){(core::int) → core::int} in true)))
13-
throw new _in::ReachabilityError::•();
13+
throw new core::StateError::•("Pattern matching error");
1414
}
1515
core::int b;
1616
block {

pkg/front_end/testcases/patterns/dynamic_guard.dart.strong.transformed.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static method main() → dynamic {
1010
{
1111
final synthesized dynamic #0#0 = core::_GrowableList::_literal1<core::int>(5);
1212
if(!(#0#0{core::List<core::int>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (let final core::int #t1 = a = #0#0{core::List<core::int>}.{core::List::[]}(0){(core::int) → core::int} in true)))
13-
throw new _in::ReachabilityError::•();
13+
throw new core::StateError::•("Pattern matching error");
1414
}
1515
core::int b;
1616
block {

pkg/front_end/testcases/patterns/dynamic_guard.dart.weak.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static method main() → dynamic {
1010
{
1111
final synthesized dynamic #0#0 = <core::int>[5];
1212
if(!(#0#0{core::List<core::int>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (let final dynamic #t1 = a = #0#0{core::List<core::int>}.{core::List::[]}(0){(core::int) → core::int} in true)))
13-
throw new _in::ReachabilityError::•();
13+
throw new core::StateError::•("Pattern matching error");
1414
}
1515
core::int b;
1616
block {

pkg/front_end/testcases/patterns/dynamic_guard.dart.weak.modular.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static method main() → dynamic {
1010
{
1111
final synthesized dynamic #0#0 = <core::int>[5];
1212
if(!(#0#0{core::List<core::int>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (let final dynamic #t1 = a = #0#0{core::List<core::int>}.{core::List::[]}(0){(core::int) → core::int} in true)))
13-
throw new _in::ReachabilityError::•();
13+
throw new core::StateError::•("Pattern matching error");
1414
}
1515
core::int b;
1616
block {

pkg/front_end/testcases/patterns/dynamic_guard.dart.weak.transformed.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static method main() → dynamic {
1010
{
1111
final synthesized dynamic #0#0 = core::_GrowableList::_literal1<core::int>(5);
1212
if(!(#0#0{core::List<core::int>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (let final core::int #t1 = a = #0#0{core::List<core::int>}.{core::List::[]}(0){(core::int) → core::int} in true)))
13-
throw new _in::ReachabilityError::•();
13+
throw new core::StateError::•("Pattern matching error");
1414
}
1515
core::int b;
1616
block {

pkg/front_end/testcases/patterns/error_cases.dart.strong.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ library /*isNonNullableByDefault*/;
3434
// ^
3535
//
3636
import self as self;
37-
import "dart:_internal" as _in;
37+
import "dart:core" as core;
3838

3939
static method method() → dynamic {
4040
final dynamic Square;
@@ -47,6 +47,6 @@ static method method() → dynamic {
4747
Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
4848
final (42) = 42;
4949
^")
50-
throw new _in::ReachabilityError::•();
50+
throw new core::StateError::•("Pattern matching error");
5151
}
5252
}

pkg/front_end/testcases/patterns/error_cases.dart.strong.transformed.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ library /*isNonNullableByDefault*/;
3434
// ^
3535
//
3636
import self as self;
37-
import "dart:_internal" as _in;
37+
import "dart:core" as core;
3838

3939
static method method() → dynamic {
4040
final dynamic Square;
@@ -47,6 +47,6 @@ static method method() → dynamic {
4747
Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
4848
final (42) = 42;
4949
^")
50-
throw new _in::ReachabilityError::•();
50+
throw new core::StateError::•("Pattern matching error");
5151
}
5252
}

pkg/front_end/testcases/patterns/error_cases.dart.weak.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ library /*isNonNullableByDefault*/;
3434
// ^
3535
//
3636
import self as self;
37-
import "dart:_internal" as _in;
37+
import "dart:core" as core;
3838

3939
static method method() → dynamic {
4040
final dynamic Square;
@@ -47,6 +47,6 @@ static method method() → dynamic {
4747
Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
4848
final (42) = 42;
4949
^")
50-
throw new _in::ReachabilityError::•();
50+
throw new core::StateError::•("Pattern matching error");
5151
}
5252
}

pkg/front_end/testcases/patterns/error_cases.dart.weak.modular.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ library /*isNonNullableByDefault*/;
3434
// ^
3535
//
3636
import self as self;
37-
import "dart:_internal" as _in;
37+
import "dart:core" as core;
3838

3939
static method method() → dynamic {
4040
final dynamic Square;
@@ -47,6 +47,6 @@ static method method() → dynamic {
4747
Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
4848
final (42) = 42;
4949
^")
50-
throw new _in::ReachabilityError::•();
50+
throw new core::StateError::•("Pattern matching error");
5151
}
5252
}

pkg/front_end/testcases/patterns/error_cases.dart.weak.transformed.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ library /*isNonNullableByDefault*/;
3434
// ^
3535
//
3636
import self as self;
37-
import "dart:_internal" as _in;
37+
import "dart:core" as core;
3838

3939
static method method() → dynamic {
4040
final dynamic Square;
@@ -47,6 +47,6 @@ static method method() → dynamic {
4747
Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
4848
final (42) = 42;
4949
^")
50-
throw new _in::ReachabilityError::•();
50+
throw new core::StateError::•("Pattern matching error");
5151
}
5252
}

0 commit comments

Comments
 (0)