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/front_end/lib/src/fasta/source/source_library_builder.dart

Issue 2917853002: Compute correct return type for factory methods. (Closed)
Patch Set: Include changes from CL 2916533003. Created 3 years, 7 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 | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/source/source_library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 9395ce795d36ece74dee8fa2fc35e24fa0da833a..49daa15ba073d377ecb56bb63e0ab783c3d6ab19 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -30,6 +30,7 @@ import '../builder/builder.dart'
LibraryBuilder,
MemberBuilder,
MetadataBuilder,
+ NamedTypeBuilder,
PrefixBuilder,
ProcedureBuilder,
Scope,
@@ -540,6 +541,14 @@ class DeclarationBuilder<T extends TypeBuilder> {
assert(procedure.typeVariables.isEmpty);
procedure.typeVariables
.addAll(library.copyTypeVariables(typeVariables));
+ DeclarationBuilder<T> savedDeclaration = library.currentDeclaration;
+ library.currentDeclaration = declaration;
+ for (TypeVariableBuilder tv in procedure.typeVariables) {
+ NamedTypeBuilder<T, dynamic> t = procedure.returnType;
+ t.arguments
+ .add(library.addNamedType(tv.name, null, procedure.charOffset));
+ }
+ library.currentDeclaration = savedDeclaration;
declaration.resolveTypes(procedure.typeVariables, library);
});
Map<String, TypeVariableBuilder> map = <String, TypeVariableBuilder>{};
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698