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

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

Issue 9677055: Remove unused code in ResolveVisitor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java b/compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java
index aad2e7988d4ccd3fb6d8f6f1792e93ade3c3e68d..1eca0a036e95d928b4ae3023b42a4ff1fe10e848 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java
@@ -12,11 +12,9 @@ import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartParameter;
import com.google.dart.compiler.ast.DartTypeNode;
-import com.google.dart.compiler.ast.DartTypeParameter;
import com.google.dart.compiler.type.DynamicType;
import com.google.dart.compiler.type.FunctionType;
import com.google.dart.compiler.type.Type;
-import com.google.dart.compiler.type.TypeVariable;
import com.google.dart.compiler.type.Types;
import java.util.ArrayList;
@@ -51,22 +49,7 @@ abstract class ResolveVisitor extends ASTVisitor<Element> {
return element;
}
- private void bindReturnGenerics(DartTypeNode node) {
- for (DartTypeNode typeNode : node.getTypeArguments()) {
- if (ElementKind.of(typeNode.getType().getElement()) != ElementKind.TYPE_VARIABLE) {
- bindReturnGenerics(typeNode);
- continue;
- }
- bindTypeVariable((TypeVariableElement) typeNode.getType().getElement());
- }
- }
-
final FunctionAliasElement resolveFunctionAlias(DartFunctionTypeAlias node) {
- // The purpose of this to find generic types and make sure they are bound to object.
- DartTypeNode returnNode = node.getReturnTypeNode();
- if (returnNode != null) {
- bindReturnGenerics(returnNode);
- }
FunctionAliasElement funcAlias = node.getElement();
for (Type type : funcAlias.getTypeParameters()) {
TypeVariableElement typeVar = (TypeVariableElement) type.getElement();
@@ -75,31 +58,6 @@ abstract class ResolveVisitor extends ASTVisitor<Element> {
return null;
}
- void bindTypeVariable(TypeVariableElement variable) {
- DartTypeParameter typeParameterNode = (DartTypeParameter) variable.getNode();
- DartTypeNode boundNode = typeParameterNode.getBound();
- if (boundNode != null) {
- Type bound =
- getContext().resolveType(
- boundNode,
- true,
- isFactoryContext(),
- ResolverErrorCode.NO_SUCH_TYPE);
- boundNode.setType(bound);
- }
- }
-
- void bindTypeVariables(List<TypeVariable> typeVariables) {
- if (typeVariables == null) {
- return;
- }
- for (TypeVariable typeParameter : typeVariables) {
- TypeVariableElement variable = (TypeVariableElement) typeParameter.getElement();
- bindTypeVariable(variable);
- getContext().getScope().declareElement(variable.getName(), variable);
- }
- }
-
abstract boolean isStaticContext();
abstract boolean isFactoryContext();
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698