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

Unified Diff: dart/pkg/compiler/lib/src/resolution/members.dart

Issue 808953004: Recover from fatal parser errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42860. Created 5 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
Index: dart/pkg/compiler/lib/src/resolution/members.dart
diff --git a/dart/pkg/compiler/lib/src/resolution/members.dart b/dart/pkg/compiler/lib/src/resolution/members.dart
index 74ec34ed69822593b30a10e80cef15ad78e02202..0210a4afda84bb058f3c2fe43ac3a2abb4993663 100644
--- a/dart/pkg/compiler/lib/src/resolution/members.dart
+++ b/dart/pkg/compiler/lib/src/resolution/members.dart
@@ -1873,10 +1873,13 @@ class TypeResolver {
ambiguous.messageKind, ambiguous.messageArguments);
ambiguous.diagnose(registry.mapping.analyzedElement, compiler);
} else if (element.isErroneous) {
- ErroneousElement erroneousElement = element;
- type = reportFailureAndCreateType(
- erroneousElement.messageKind, erroneousElement.messageArguments,
- erroneousElement: erroneousElement);
+ if (element is ErroneousElement) {
+ type = reportFailureAndCreateType(
+ element.messageKind, element.messageArguments,
+ erroneousElement: element);
+ } else {
+ type = const DynamicType();
+ }
} else if (!element.impliesType) {
type = reportFailureAndCreateType(
MessageKind.NOT_A_TYPE, {'node': node.typeName});
« no previous file with comments | « dart/pkg/compiler/lib/src/patch_parser.dart ('k') | dart/pkg/compiler/lib/src/scanner/class_element_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698