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

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

Issue 8322014: Adds static type checking to the foreach loop. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased past r505 (Array -> List in TATs) Created 9 years, 2 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/Elements.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Elements.java b/compiler/java/com/google/dart/compiler/resolver/Elements.java
index 08d2f3397e78df5fcee2606efdfcbfd5cdcf9bb8..63d1872436bd11746e281f826fd06b752ebc39dd 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Elements.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Elements.java
@@ -96,7 +96,8 @@ public class Elements {
}
}
- static void addMethod(EnclosingElement holder, MethodElement method) {
+ @VisibleForTesting
+ public static void addMethod(EnclosingElement holder, MethodElement method) {
if (ElementKind.of(holder).equals(ElementKind.CLASS)) {
((ClassElementImplementation) holder).addMethod(method);
} else if (ElementKind.of(holder).equals(ElementKind.LIBRARY)) {
@@ -119,7 +120,9 @@ public class Elements {
return MethodElementImplementation.fromFunctionExpression(node, modifiers);
}
- static MethodElement methodFromMethodNode(DartMethodDefinition node, EnclosingElement holder) {
+ @VisibleForTesting
+ public static MethodElement methodFromMethodNode(DartMethodDefinition node,
+ EnclosingElement holder) {
return MethodElementImplementation.fromMethodNode(node, holder);
}
@@ -131,7 +134,8 @@ public class Elements {
constructorType);
}
- static void setType(Element element, Type type) {
+ @VisibleForTesting
+ public static void setType(Element element, Type type) {
((AbstractElement) element).setType(type);
}

Powered by Google App Engine
This is Rietveld 408576698