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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2662963003: Reset serialized expression to empty on StateError. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | pkg/analyzer/lib/src/summary/summarize_const_expr.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 0587df1322e7bb2621550c509412fd6c96ea3054..87bbebc6cea1a915e530ca96cb0514b4929a0bdc 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -1980,6 +1980,10 @@ class ExprTypeComputer {
// return type. Assume `dynamic`.
return DynamicTypeImpl.instance;
}
+ // If no operations, we cannot compute the type. Assume `dynamic`.
+ if (unlinkedConst.operations.isEmpty) {
+ return DynamicTypeImpl.instance;
+ }
// Perform RPN evaluation of the constant, using a stack of inferred types.
for (UnlinkedExprOperation operation in unlinkedConst.operations) {
switch (operation) {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summarize_const_expr.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698