Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2124)

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart

Issue 2955443002: Add regression tests from Luke's bug reports. Part 1. (Closed)
Patch Set: Use [program]. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/messages.dart ('k') | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
index 61300251613832180c7f06abfbecb5ebac667d7f..0ab9748c0672b6f89342d5cec474ac0ee5045b21 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
@@ -17,6 +17,7 @@ import 'package:kernel/ast.dart'
Field,
FunctionType,
InterfaceType,
+ Location,
Member,
Procedure,
TypeParameter,
@@ -25,6 +26,10 @@ import 'package:kernel/class_hierarchy.dart';
import 'package:kernel/core_types.dart';
import 'package:kernel/type_algebra.dart';
+import '../errors.dart' show Crash;
+
+import '../messages.dart' show getLocationFromNode;
+
/// Data structure for tracking dependencies among fields, getters, and setters
/// that require type inference.
///
@@ -279,8 +284,17 @@ abstract class TypeInferenceEngineImpl extends TypeInferenceEngine {
new _AccessorWalker().walk(accessorNode);
}
}
- for (var formal in initializingFormals) {
- formal.type = _inferInitializingFormalType(formal);
+ for (KernelVariableDeclaration formal in initializingFormals) {
+ try {
+ formal.type = _inferInitializingFormalType(formal);
+ } catch (e, s) {
+ Location location = getLocationFromNode(formal);
+ if (location == null) {
+ rethrow;
+ } else {
+ throw new Crash(Uri.parse(location.file), formal.fileOffset, e, s);
+ }
+ }
}
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/messages.dart ('k') | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698