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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2985673002: Parse type variables of local functions before return type. (Closed)
Patch Set: Created 3 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: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 720ed79084120164a6a5bff99955b66967bcdef7..afbab2f12293ecf3286cf09fbe8c8de4599587df 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -2490,11 +2490,6 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
exitLocalScope();
}
FormalParameters formals = pop();
- List<TypeParameter> typeParameters = typeVariableBuildersToKernel(pop());
- FunctionNode function = formals.addToFunction(new FunctionNode(body,
- typeParameters: typeParameters, asyncMarker: asyncModifier)
- ..fileOffset = formals.charOffset
- ..fileEndOffset = token.charOffset);
exitLocalScope();
var declaration = pop();
var returnType = pop();
@@ -2502,6 +2497,11 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
returnType ??= const DynamicType();
pop(); // Modifiers.
exitFunction();
+ List<TypeParameter> typeParameters = typeVariableBuildersToKernel(pop());
+ FunctionNode function = formals.addToFunction(new FunctionNode(body,
+ typeParameters: typeParameters, asyncMarker: asyncModifier)
+ ..fileOffset = formals.charOffset
+ ..fileEndOffset = token.charOffset);
if (declaration is FunctionDeclaration) {
KernelFunctionDeclaration.setHasImplicitReturnType(
declaration, hasImplicitReturnType);

Powered by Google App Engine
This is Rietveld 408576698