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

Unified Diff: pkg/kernel/lib/binary/ast_to_binary.dart

Issue 2985293002: Add optional FunctionType.positionalParameterNames and use them to resynthesize function-type forma… (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/kernel/lib/binary/ast_to_binary.dart
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index 16d7f0cc8c9bf01c6e6b3918f0130da4936a5477..9cf4b7058a8e7ad069775b6ddcef585bee5907c5 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -1115,6 +1115,7 @@ class BinaryPrinter extends Visitor {
node.namedParameters.isEmpty) {
writeByte(Tag.SimpleFunctionType);
writeNodeList(node.positionalParameters);
+ writeStringReferenceList(node.positionalParameterNames);
writeNode(node.returnType);
} else {
writeByte(Tag.FunctionType);
@@ -1125,6 +1126,7 @@ class BinaryPrinter extends Visitor {
node.positionalParameters.length + node.namedParameters.length);
writeNodeList(node.positionalParameters);
writeNodeList(node.namedParameters);
+ writeStringReferenceList(node.positionalParameterNames);
writeNode(node.returnType);
_typeParameterIndexer.exit(node.typeParameters);
}
@@ -1385,6 +1387,12 @@ class StringIndexer extends RecursiveVisitor<Null> {
super.visitField(node);
}
+ @override
+ visitFunctionType(FunctionType node) {
+ node.positionalParameterNames.forEach(put);
+ super.visitFunctionType(node);
+ }
+
visitNamedExpression(NamedExpression node) {
put(node.name);
node.visitChildren(this);

Powered by Google App Engine
This is Rietveld 408576698