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

Unified Diff: pkg/compiler/lib/src/resolution/scope.dart

Issue 1915123008: Implements support for ignoring method type arguments in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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: pkg/compiler/lib/src/resolution/scope.dart
diff --git a/pkg/compiler/lib/src/resolution/scope.dart b/pkg/compiler/lib/src/resolution/scope.dart
index 41df8033f6ef8b6710d5d7f0ab20b202471393f4..05473790843defd69f4bd9930bc48dac9dbc7b34 100644
--- a/pkg/compiler/lib/src/resolution/scope.dart
+++ b/pkg/compiler/lib/src/resolution/scope.dart
@@ -58,17 +58,14 @@ class VariableDefinitionScope extends NestedScope {
}
}
-/**
- * [TypeDeclarationScope] defines the outer scope of a type declaration in
- * which the declared type variables and the entities in the enclosing scope are
- * available but where declared and inherited members are not available. This
- * scope is only used for class declarations during resolution of the
- * class hierarchy. In all other cases [ClassScope] is used.
- */
-class TypeDeclarationScope extends NestedScope {
- final TypeDeclarationElement element;
-
- TypeDeclarationScope(parent, this.element) : super(parent) {
+/// [TypeVariablesScope] defines the outer scope in a context where some type
+/// variables are declared and the entities in the enclosing scope are
+/// available, but where locally declared and inherited members are not
+/// available.
+abstract class TypeVariablesScope extends NestedScope {
+ List<DartType> get typeVariables;
+
+ TypeVariablesScope(Scope parent) : super(parent) {
assert(parent != null);
}
@@ -77,7 +74,6 @@ class TypeDeclarationScope extends NestedScope {
}
Element lookupTypeVariable(String name) {
- List<DartType> typeVariables = element.typeVariables;
for (TypeVariableType type in typeVariables) {
if (type.name == name) {
return type.element;
@@ -87,6 +83,22 @@ class TypeDeclarationScope extends NestedScope {
}
Element localLookup(String name) => lookupTypeVariable(name);
+}
+
+/**
+ * [TypeDeclarationScope] defines the outer scope of a type declaration in
+ * which the declared type variables and the entities in the enclosing scope are
+ * available but where declared and inherited members are not available. This
+ * scope is only used for class declarations during resolution of the
+ * class hierarchy. In all other cases [ClassScope] is used.
Johnni Winther 2016/04/29 07:21:06 It is also used for resolving typedef signatures.
eernst 2016/04/29 13:24:50 Done.
+ */
+class TypeDeclarationScope extends TypeVariablesScope {
+ final GenericElement element;
+
+ @override
+ List<DartType> get typeVariables => element.typeVariables;
+
+ TypeDeclarationScope(Scope parent, this.element) : super(parent);
String toString() => 'TypeDeclarationScope($element)';
}

Powered by Google App Engine
This is Rietveld 408576698