Index: pkg/compiler/lib/src/elements/elements.dart |
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart |
index 5d3137271975ba89b0b4a7327a85fb6f5125888c..0216f562bad7ca5d9890368b7f1163ed73076d8d 100644 |
--- a/pkg/compiler/lib/src/elements/elements.dart |
+++ b/pkg/compiler/lib/src/elements/elements.dart |
@@ -486,12 +486,7 @@ class Elements { |
return true; |
} |
- static bool hasAccessToTypeVariable(Element element, |
- TypeVariableElement typeVariable) { |
- GenericElement declaration = typeVariable.typeDeclaration; |
- if (declaration is FunctionElement || declaration is ParameterElement) { |
- return true; |
- } |
+ static bool hasAccessToTypeVariables(Element element) { |
Element outer = element.outermostEnclosingMemberOrTopLevel; |
return (outer != null && outer.isFactoryConstructor) || |
!isInStaticContext(element); |
@@ -1112,7 +1107,6 @@ abstract class AbstractFieldElement extends Element { |
abstract class FunctionSignature { |
FunctionType get type; |
- List<DartType> get typeVariables; |
List<FormalElement> get requiredParameters; |
List<FormalElement> get optionalParameters; |
@@ -1140,8 +1134,7 @@ abstract class FunctionElement extends Element |
AstElement, |
TypedElement, |
FunctionTypedElement, |
- ExecutableElement, |
- GenericElement { |
+ ExecutableElement { |
FunctionExpression get node; |
FunctionElement get patch; |
@@ -1149,7 +1142,7 @@ abstract class FunctionElement extends Element |
bool get hasFunctionSignature; |
- /// The parameters of this function. |
+ /// The parameters of this functions. |
List<ParameterElement> get parameters; |
/// The type of this function. |
@@ -1329,20 +1322,9 @@ abstract class ConstructorBodyElement extends MethodElement { |
FunctionElement get constructor; |
} |
-/// [GenericElement] defines the common interface for generic functions and |
-/// [TypeDeclarationElement]. |
-abstract class GenericElement extends Element implements AstElement { |
- /** |
- * The type variables declared on this declaration. The type variables are not |
- * available until the type of the element has been computed through |
- * [computeType]. |
- */ |
- List<DartType> get typeVariables; |
-} |
- |
/// [TypeDeclarationElement] defines the common interface for class/interface |
/// declarations and typedefs. |
-abstract class TypeDeclarationElement extends GenericElement { |
+abstract class TypeDeclarationElement extends Element implements AstElement { |
/// The name of this type declaration, taking privacy into account. |
Name get memberName; |
@@ -1384,6 +1366,13 @@ abstract class TypeDeclarationElement extends GenericElement { |
*/ |
GenericType get rawType; |
+ /** |
+ * The type variables declared on this declaration. The type variables are not |
+ * available until the type of the element has been computed through |
+ * [computeType]. |
+ */ |
+ List<DartType> get typeVariables; |
+ |
bool get isResolved; |
void ensureResolved(Resolution resolution); |
@@ -1580,9 +1569,8 @@ abstract class TypeVariableElement extends Element |
@deprecated |
get enclosingElement; |
- /// The class, typedef, function, method, or function typed parameter on |
- /// which this type variable is defined. |
- GenericElement get typeDeclaration; |
+ /// The class or typedef on which this type variable is defined. |
+ TypeDeclarationElement get typeDeclaration; |
/// The index of this type variable within its type declaration. |
int get index; |
@@ -1624,7 +1612,7 @@ abstract class TypedElement extends Element { |
} |
/// An [Element] that can define a function type. |
-abstract class FunctionTypedElement extends Element implements GenericElement { |
+abstract class FunctionTypedElement extends Element { |
/// The function signature for the function type defined by this element, |
/// if any. |
FunctionSignature get functionSignature; |