Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
index 1528888cb06c7d89355eedec77e5feffa9af4bb7..657e1be992be10e7956710023fcf65226af27ef9 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
@@ -40,6 +40,8 @@ import 'package:kernel/core_types.dart' show CoreTypes; |
import 'frontend_accessors.dart' show buildIsNull, makeBinary, makeLet; |
+import '../messages.dart' as messages show getLocationFromUri; |
+ |
import '../../scanner/token.dart' show BeginToken, Token; |
import '../scanner/token.dart' show isBinaryOperator, isMinusOperator; |
@@ -2996,9 +2998,15 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper { |
Expression buildFallThroughError(int charOffset) { |
warningNotError("Switch case may fall through to next case.", charOffset); |
- Builder constructor = library.loader.getFallThroughError(); |
+ |
+ Location location = messages.getLocationFromUri(uri, charOffset); |
+ |
return new Throw(buildStaticInvocation( |
- constructor.target, new Arguments.empty(), |
+ library.loader.coreTypes.fallThroughErrorUrlAndLineConstructor, |
+ new Arguments(<Expression>[ |
+ new StringLiteral(location?.file ?? uri.toString()), |
+ new IntLiteral(location?.line ?? 0) |
+ ]), |
charOffset: charOffset)); |
} |