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

Unified Diff: lib/compiler/implementation/typechecker.dart

Issue 10829379: Add erroneous elements for function types and use them to allow unresolvable constructors to be han… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and rebase. Created 8 years, 4 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: lib/compiler/implementation/typechecker.dart
diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart
index 8c36f1f797c130ca126d8835e49d6f1753b77471..a5489eedaaff9abb5f814cad83d1e11d1d80fb65 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -395,6 +395,7 @@ class TypeCheckerVisitor implements Visitor<Type> {
Type returnType;
Type previousType;
final FunctionElement element = elements[node];
+ if (Element.isInvalid(element)) return types.dynamicType;
if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR ||
element.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
type = types.dynamicType;
@@ -707,7 +708,7 @@ class TypeCheckerVisitor implements Visitor<Type> {
}
Type computeType(Element element) {
- if (element === null) return types.dynamicType;
+ if (Element.isInvalid(element)) return types.dynamicType;
Type result = element.computeType(compiler);
return (result !== null) ? result : types.dynamicType;
}

Powered by Google App Engine
This is Rietveld 408576698