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

Unified Diff: pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart

Issue 2695453002: Generalize DeclarationBuilder.resolveTypes. (Closed)
Patch Set: Created 3 years, 10 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/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart b/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
index 8a6088a450bf1e10385092b0f6d55e63db9ec24b..6f5c7945839944f32c2386301e48c3a1e0e0d912 100644
--- a/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
@@ -12,9 +12,6 @@ import 'builder.dart' show
TypeDeclarationBuilder,
TypeVariableBuilder;
-import 'scope.dart' show
- Scope;
-
abstract class FunctionTypeAliasBuilder<T extends TypeBuilder, R>
extends TypeDeclarationBuilder<T, R> {
final T returnType;
@@ -25,28 +22,9 @@ abstract class FunctionTypeAliasBuilder<T extends TypeBuilder, R>
FunctionTypeAliasBuilder(
List<MetadataBuilder> metadata, this.returnType,
- String name, this.typeVariables, this.formals, List<T> types,
+ String name, this.typeVariables, this.formals,
LibraryBuilder parent, int charOffset)
- : super(metadata, null, name, types, parent, charOffset);
+ : super(metadata, null, name, parent, charOffset);
LibraryBuilder get parent => super.parent;
-
- int resolveTypes(LibraryBuilder library) {
- assert(library == parent || library == parent.partOfLibrary);
- // TODO(ahe): Only create nested scope if typeVariables != null. It should
- // be safe here, but for constructor field initializers, use the enclosing
- // scope to lookup fields.
- Scope scope = library.scope.createNestedScope();
- if (typeVariables != null) {
- for (TypeVariableBuilder t in typeVariables) {
- scope[t.name] = t;
- }
- }
- if (types != null) {
- for (T t in types) {
- t.resolveIn(scope);
- }
- }
- return types.length;
- }
}

Powered by Google App Engine
This is Rietveld 408576698