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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java

Issue 10021017: Adds parser recovery for type parameters and type arguments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updates for completion to work Created 8 years, 8 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: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
index 970d7984ffda0d57e6c6047da539af9afe88d96b..b1ed06f2db06942411e081219c15887e4e4b5934 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -17,6 +17,7 @@ import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartPropertyAccess;
+import com.google.dart.compiler.ast.DartSyntheticErrorIdentifier;
import com.google.dart.compiler.ast.DartTypeNode;
import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.ast.Modifiers;
@@ -42,7 +43,7 @@ public class ResolutionContext implements ResolutionErrorListener {
private final DartCompilerContext context;
private final CoreTypeProvider typeProvider;
private final boolean suppressSdkWarnings;
-
+
ResolutionContext(String name, LibraryElement library, DartCompilerContext context,
CoreTypeProvider typeProvider) {
this(new Scope(name, library), context, typeProvider);
@@ -240,7 +241,7 @@ public class ResolutionContext implements ResolutionErrorListener {
identifier);
} else {
onError(identifier, TypeErrorCode.TYPE_VARIABLE_IN_STATIC_CONTEXT,
- identifier);
+ identifier);
}
return typeProvider.getDynamicType();
@@ -269,7 +270,9 @@ public class ResolutionContext implements ResolutionErrorListener {
}
break;
default:
- onError(identifier, TypeErrorCode.NOT_A_TYPE, identifier, elementKind);
+ if (!(identifier instanceof DartSyntheticErrorIdentifier)) {
+ onError(identifier, TypeErrorCode.NOT_A_TYPE, identifier, elementKind);
+ }
}
onError(identifier, errorCode, identifier);
return typeProvider.getDynamicType();
@@ -397,5 +400,10 @@ public class ResolutionContext implements ResolutionErrorListener {
String name = node.getName();
return scope.findElement(scope.getLibrary(), name);
}
+
+ @Override
+ public Element visitSyntheticErrorIdentifier(DartSyntheticErrorIdentifier node) {
+ return Elements.dynamicElement();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698