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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.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/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 3fe8c375ade671f91cdd0d2011c8ee3681b62a95..4a2f0ca3b016362bd4e519f080336b54c1e20478 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -80,6 +80,7 @@ import com.google.dart.compiler.ast.DartSuperConstructorInvocation;
import com.google.dart.compiler.ast.DartSuperExpression;
import com.google.dart.compiler.ast.DartSwitchStatement;
import com.google.dart.compiler.ast.DartSyntheticErrorExpression;
+import com.google.dart.compiler.ast.DartSyntheticErrorIdentifier;
import com.google.dart.compiler.ast.DartSyntheticErrorStatement;
import com.google.dart.compiler.ast.DartThisExpression;
import com.google.dart.compiler.ast.DartThrowStatement;
@@ -125,7 +126,7 @@ import java.util.Set;
* Analyzer of static type information.
*/
public class TypeAnalyzer implements DartCompilationPhase {
-
+
private final Set<ClassElement> diagnosedAbstractClasses = Sets.newHashSet();
/**
@@ -170,7 +171,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
private final InterfaceType dynamicIteratorType;
private final boolean developerModeChecks;
private final boolean suppressSdkWarnings;
-
+
/**
* Keeps track of the number of nested catches, used to detect re-throws
* outside of any catch block.
@@ -780,7 +781,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
@Override
public Type visitMethodInvocation(DartMethodInvocation node) {
String name = node.getFunctionNameString();
- Element element = (Element) node.getElement();
+ Element element = node.getElement();
if (element != null && (element.getModifiers().isStatic()
|| Elements.isTopLevel(element))) {
node.setElement(element);
@@ -1034,6 +1035,11 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
@Override
+ public Type visitSyntheticErrorIdentifier(DartSyntheticErrorIdentifier node) {
+ return dynamicType;
+ }
+
+ @Override
public Type visitIdentifier(DartIdentifier node) {
Element element = node.getElement();
Type type;

Powered by Google App Engine
This is Rietveld 408576698