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

Unified Diff: pkg/compiler/lib/src/serialization/equivalence.dart

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. 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/compiler/lib/src/serialization/equivalence.dart
diff --git a/pkg/compiler/lib/src/serialization/equivalence.dart b/pkg/compiler/lib/src/serialization/equivalence.dart
index 3fd3f451a665029061a93ba5cbba20e11e7b4290..6322a05e94d3fd567186c3be7389dfa68da5b696 100644
--- a/pkg/compiler/lib/src/serialization/equivalence.dart
+++ b/pkg/compiler/lib/src/serialization/equivalence.dart
@@ -2044,7 +2044,8 @@ class NodeEquivalenceVisitor implements Visitor1<bool, Node> {
}
@override
- bool visitTypeAnnotation(TypeAnnotation node1, TypeAnnotation node2) {
+ bool visitNominalTypeAnnotation(
+ NominalTypeAnnotation node1, NominalTypeAnnotation node2) {
return testNodes(
node1, node2, 'typeName', node1.typeName, node2.typeName) &&
testNodes(node1, node2, 'typeArguments', node1.typeArguments,
@@ -2052,6 +2053,16 @@ class NodeEquivalenceVisitor implements Visitor1<bool, Node> {
}
@override
+ bool visitFunctionTypeAnnotation(
+ FunctionTypeAnnotation node1, FunctionTypeAnnotation node2) {
+ return testNodes(
+ node1, node2, 'returnType', node1.returnType, node2.returnType) &&
+ testNodes(node1, node2, 'formals', node1.formals, node2.formals) &&
+ testNodes(node1, node2, 'typeParameters', node1.typeParameters,
+ node2.typeParameters);
+ }
+
+ @override
bool visitTypeVariable(TypeVariable node1, TypeVariable node2) {
return testNodes(node1, node2, 'name', node1.name, node2.name) &&
testNodes(node1, node2, 'bound', node1.bound, node2.bound);
@@ -2065,8 +2076,8 @@ class NodeEquivalenceVisitor implements Visitor1<bool, Node> {
testNodes(
node1, node2, 'returnType', node1.returnType, node2.returnType) &&
testNodes(node1, node2, 'name', node1.name, node2.name) &&
- testNodes(node1, node2, 'typeParameters', node1.typeParameters,
- node2.typeParameters) &&
+ testNodes(node1, node2, 'typeParameters', node1.templateParameters,
+ node2.templateParameters) &&
testNodes(node1, node2, 'formals', node1.formals, node2.formals);
}
@@ -2121,6 +2132,11 @@ class NodeEquivalenceVisitor implements Visitor1<bool, Node> {
bool visitStringNode(StringNode node1, StringNode node2) {
throw new UnsupportedError('Unexpected nodes: $node1 <> $node2');
}
+
+ @override
+ bool visitTypeAnnotation(TypeAnnotation node1, TypeAnnotation node2) {
+ throw new UnsupportedError('Unexpected nodes: $node1 <> $node2');
+ }
}
bool areMetadataAnnotationsEquivalent(

Powered by Google App Engine
This is Rietveld 408576698