Index: frog/leg/resolver.dart |
diff --git a/frog/leg/resolver.dart b/frog/leg/resolver.dart |
index 369b69d04cae420c30c9804922173f10352e2ae7..d97f4682aec0f01af1a45be9be90684a0733e76f 100644 |
--- a/frog/leg/resolver.dart |
+++ b/frog/leg/resolver.dart |
@@ -813,6 +813,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> { |
void handleArguments(Send node) { |
int count = 0; |
List<SourceString> namedArguments = <SourceString>[]; |
+ bool seenNamedArgument = false; |
for (Link<Node> link = node.argumentsNode.nodes; |
!link.isEmpty(); |
link = link.tail) { |
@@ -820,8 +821,11 @@ class ResolverVisitor extends CommonResolverVisitor<Element> { |
Expression argument = link.head; |
visit(argument); |
if (argument.asNamedArgument() != null) { |
+ seenNamedArgument = true; |
NamedArgument named = argument; |
namedArguments.add(named.name.source); |
+ } else if (seenNamedArgument) { |
+ error(argument, MessageKind.INVALID_ARGUMENT_AFTER_NAMED); |
} |
} |
mapping.setSelector(node, new Invocation(count, namedArguments)); |