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

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

Issue 2969053002: Implement type variables on old style function-typed formal parameters. (Closed)
Patch Set: Add comment. 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 f27cdfc51a2f2779e2b06fb732709b12e3d4331a..283adcb7163dd835a9dd638aa8b8a32a58c0ea3d 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1700,6 +1700,10 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
@override
void beginFunctionType(Token beginToken) {
debugEvent("beginFunctionType");
+ enterFunctionTypeScope();
+ }
+
+ void enterFunctionTypeScope() {
List typeVariables = pop();
enterLocalScope(scope.createNestedScope(isModifiable: false));
push(typeVariables ?? NullValue.TypeVariables);
@@ -1857,21 +1861,21 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
void beginFunctionTypedFormalParameter(Token token) {
debugEvent("beginFunctionTypedFormalParameter");
functionNestingLevel++;
+ enterFunctionTypeScope();
}
@override
- void endFunctionTypedFormalParameter(
- Token thisKeyword, FormalParameterType kind) {
+ void endFunctionTypedFormalParameter() {
debugEvent("FunctionTypedFormalParameter");
if (inCatchClause || functionNestingLevel != 0) {
exitLocalScope();
}
FormalParameters formals = pop();
- ignore(Unhandled.TypeVariables);
- Identifier name = pop();
DartType returnType = pop();
- push(formals.toFunctionType(returnType));
- push(name);
+ List<TypeParameter> typeVariables = typeVariableBuildersToKernel(pop());
+ FunctionType type = formals.toFunctionType(returnType, typeVariables);
+ exitLocalScope();
+ push(type);
functionNestingLevel--;
}
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_function_type_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698