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

Unified Diff: dart/compiler/java/com/google/dart/compiler/type/TypeVariableImplementation.java

Issue 20722006: Removed compiler/ directory from repository (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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: dart/compiler/java/com/google/dart/compiler/type/TypeVariableImplementation.java
diff --git a/dart/compiler/java/com/google/dart/compiler/type/TypeVariableImplementation.java b/dart/compiler/java/com/google/dart/compiler/type/TypeVariableImplementation.java
deleted file mode 100644
index 6df862b210470bd742e5b072b20287b2a019d64e..0000000000000000000000000000000000000000
--- a/dart/compiler/java/com/google/dart/compiler/type/TypeVariableImplementation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-package com.google.dart.compiler.type;
-
-import com.google.dart.compiler.resolver.Element;
-import com.google.dart.compiler.resolver.TypeVariableElement;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Default implementation of {@link TypeVariable}.
- */
-class TypeVariableImplementation extends AbstractType implements TypeVariable {
- private final TypeVariableElement element;
-
- public TypeVariableImplementation(TypeVariableElement element) {
- this.element = element;
- }
-
- @Override
- public TypeVariableElement getElement() {
- return element;
- }
-
- @Override
- public TypeVariableElement getTypeVariableElement() {
- return getElement();
- }
-
- @Override
- public String toString() {
- Element owner = element.getDeclaringElement();
- if (owner == null) {
- return element.getName();
- } else {
- return owner.getName() + "." + element.getName();
- }
- }
-
- @Override
- public Type subst(List<Type> arguments, List<Type> parameters) {
- Iterator<? extends Type> itA = arguments.iterator();
- Iterator<? extends Type> itP = parameters.iterator();
- while (itA.hasNext() && itP.hasNext()) {
- Type argument = itA.next();
- Type parameter = itP.next();
- if (equals(parameter)) {
- return argument;
- }
- }
-
- // O(1) check to assert arguments and parameters are of same size.
- assert itA.hasNext() == itP.hasNext() :
- "arguments: " + arguments + " parameters: " + parameters;
- return this;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof TypeVariable) {
- TypeVariable other = (TypeVariable) obj;
- return element.equals(other.getElement());
- }
- return false;
- }
-
- @Override
- public TypeKind getKind() {
- return TypeKind.VARIABLE;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698