Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit eddf73d

Browse files
author
Dart CI
committed
Version 2.19.0-429.0.dev
Merge 722109d into dev
2 parents bb6aa5a + 722109d commit eddf73d

16 files changed

+44
-61
lines changed

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

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ import '../fasta_codes.dart'
8383
templateExperimentNotEnabledOffByDefault;
8484
import '../identifiers.dart'
8585
show Identifier, InitializedIdentifier, QualifiedName, flattenName;
86-
import '../messages.dart' as messages show getLocationFromUri;
8786
import '../modifier.dart'
8887
show Modifier, constMask, covariantMask, finalMask, lateMask, requiredMask;
8988
import '../names.dart' show emptyName, minusName, plusName;
@@ -7608,25 +7607,8 @@ class BodyBuilder extends StackListenerImpl
76087607

76097608
Expression buildFallThroughError(int charOffset) {
76107609
addProblem(fasta.messageSwitchCaseFallThrough, charOffset, noLength);
7611-
7612-
// TODO(ahe): The following doesn't make sense for the Analyzer. It should
7613-
// be moved to [Forest] or conditional on `forest is Fangorn`.
7614-
7615-
// TODO(ahe): Compute a LocatedMessage above instead?
7616-
Location? location = messages.getLocationFromUri(uri, charOffset);
7617-
7618-
return forest.createThrow(
7619-
charOffset,
7620-
buildStaticInvocation(
7621-
libraryBuilder
7622-
.loader.coreTypes.fallThroughErrorUrlAndLineConstructor,
7623-
forest.createArguments(noLocation, <Expression>[
7624-
forest.createStringLiteral(
7625-
charOffset, "${location?.file ?? uri}"),
7626-
forest.createIntLiteral(charOffset, location?.line ?? 0),
7627-
]),
7628-
constness: Constness.explicitNew,
7629-
charOffset: charOffset));
7610+
return new InvalidExpression(
7611+
fasta.messageSwitchCaseFallThrough.problemMessage);
76307612
}
76317613

76327614
Expression buildAbstractClassInstantiationError(

pkg/front_end/testcases/general/fallthrough.dart.weak.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static method main(core::List<core::String*>* args) → void {
2121
case #C1:
2222
{
2323
x = 4;
24-
throw new core::FallThroughError::_create("org-dartlang-testcase:///fallthrough.dart", 10);
24+
invalid-expression "Switch case may fall through to the next case.";
2525
}
2626
#L3:
2727
case #C2:
@@ -38,7 +38,7 @@ static method main(core::List<core::String*>* args) → void {
3838
else {
3939
return;
4040
}
41-
throw new core::FallThroughError::_create("org-dartlang-testcase:///fallthrough.dart", 14);
41+
invalid-expression "Switch case may fall through to the next case.";
4242
}
4343
#L5:
4444
case #C5:

pkg/front_end/testcases/general/fallthrough.dart.weak.modular.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static method main(core::List<core::String*>* args) → void {
2121
case #C1:
2222
{
2323
x = 4;
24-
throw new core::FallThroughError::_create("org-dartlang-testcase:///fallthrough.dart", 10);
24+
invalid-expression "Switch case may fall through to the next case.";
2525
}
2626
#L3:
2727
case #C2:
@@ -38,7 +38,7 @@ static method main(core::List<core::String*>* args) → void {
3838
else {
3939
return;
4040
}
41-
throw new core::FallThroughError::_create("org-dartlang-testcase:///fallthrough.dart", 14);
41+
invalid-expression "Switch case may fall through to the next case.";
4242
}
4343
#L5:
4444
case #C5:

pkg/front_end/testcases/general/fallthrough.dart.weak.transformed.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static method main(core::List<core::String*>* args) → void {
2121
case #C1:
2222
{
2323
x = 4;
24-
throw new core::FallThroughError::_create("org-dartlang-testcase:///fallthrough.dart", 10);
24+
invalid-expression "Switch case may fall through to the next case.";
2525
}
2626
#L3:
2727
case #C2:
@@ -38,7 +38,7 @@ static method main(core::List<core::String*>* args) → void {
3838
else {
3939
return;
4040
}
41-
throw new core::FallThroughError::_create("org-dartlang-testcase:///fallthrough.dart", 14);
41+
invalid-expression "Switch case may fall through to the next case.";
4242
}
4343
#L5:
4444
case #C5:

pkg/front_end/testcases/rasta/switch_execution_case_t01.dart.weak.expect

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static method test(dynamic value) → dynamic {
3131
case #C2:
3232
{
3333
result = 2;
34-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 37);
34+
invalid-expression "Switch case may fall through to the next case.";
3535
}
3636
#L4:
3737
case #C3:
3838
{
3939
result = 3;
40-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 38);
40+
invalid-expression "Switch case may fall through to the next case.";
4141
}
4242
#L5:
4343
default:
@@ -56,7 +56,7 @@ static method testEmptyCases(dynamic value) → dynamic {
5656
case #C2:
5757
{
5858
result = 1;
59-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 48);
59+
invalid-expression "Switch case may fall through to the next case.";
6060
}
6161
#L8:
6262
case #C3:

pkg/front_end/testcases/rasta/switch_execution_case_t01.dart.weak.modular.expect

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static method test(dynamic value) → dynamic {
3131
case #C2:
3232
{
3333
result = 2;
34-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 37);
34+
invalid-expression "Switch case may fall through to the next case.";
3535
}
3636
#L4:
3737
case #C3:
3838
{
3939
result = 3;
40-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 38);
40+
invalid-expression "Switch case may fall through to the next case.";
4141
}
4242
#L5:
4343
default:
@@ -56,7 +56,7 @@ static method testEmptyCases(dynamic value) → dynamic {
5656
case #C2:
5757
{
5858
result = 1;
59-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 48);
59+
invalid-expression "Switch case may fall through to the next case.";
6060
}
6161
#L8:
6262
case #C3:

pkg/front_end/testcases/rasta/switch_execution_case_t01.dart.weak.transformed.expect

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static method test(dynamic value) → dynamic {
3131
case #C2:
3232
{
3333
result = 2;
34-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 37);
34+
invalid-expression "Switch case may fall through to the next case.";
3535
}
3636
#L4:
3737
case #C3:
3838
{
3939
result = 3;
40-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 38);
40+
invalid-expression "Switch case may fall through to the next case.";
4141
}
4242
#L5:
4343
default:
@@ -56,7 +56,7 @@ static method testEmptyCases(dynamic value) → dynamic {
5656
case #C2:
5757
{
5858
result = 1;
59-
throw new core::FallThroughError::_create("org-dartlang-testcase:///switch_execution_case_t01.dart", 48);
59+
invalid-expression "Switch case may fall through to the next case.";
6060
}
6161
#L8:
6262
case #C3:

pkg/front_end/testcases/rasta/switch_fall_through.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// @dart=2.9
66

7-
main() {
7+
test() {
88
switch (1) {
99
case 1:
1010
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// @dart = 2.9
2-
main() {}
2+
test() {}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// @dart = 2.9
2-
main() {}
2+
test() {}

0 commit comments

Comments
 (0)