Index: lib/checks.dart |
diff --git a/lib/checks.dart b/lib/checks.dart |
index 8de3b9f70d1d1cd324ced9366be718f7815601f6..a450e2f3d68f0faafdc713af95077bd6db13650f 100644 |
--- a/lib/checks.dart |
+++ b/lib/checks.dart |
@@ -75,11 +75,26 @@ class CheckReferences extends RecursiveVisitor { |
} |
visitFunctionNode(FunctionNode node) { |
+ for (int i = 1; i < node.namedParameters.length; ++i) { |
+ if (node.namedParameters[i - 1].compareTo(node.namedParameters[i]) >= 0) { |
+ throw 'Named parameters are not sorted on function found in $context'; |
+ } |
+ } |
typeParameters.addAll(node.typeParameters); |
node.visitChildren(this); |
typeParameters.removeAll(node.typeParameters); |
} |
+ visitFunctionType(FunctionType node) { |
+ for (int i = 1; i < node.namedParameters.length; ++i) { |
+ if (node.namedParameters[i - 1].compareTo(node.namedParameters[i]) >= 0) { |
+ throw 'Named parameters are not sorted on function type found in ' |
+ '$context'; |
+ } |
+ } |
+ node.visitChildren(this); |
+ } |
+ |
@override |
defaultMemberReference(Member node) { |
if (!members.contains(node)) { |