Made namedParameterTypes in the spec grammar more strict

In the specification grammar docs/language/Dart.g, named parameters in
a new style `Function` type must now have a type. They used to support
a plain `identifier` form, which means that the type was omitted and
only the name given, but the informal spec did not allow this (and this
was a decision taken because we wanted to take a step towards the kind
of function types where it is always the name which is omitted if
anything is omitted, and this means that nothing can be omitted for a
named parameter).

Change-Id: Ib2538f5bafd1e044f0b4f22ea0a6b9a339f81501
Reviewed-on: https://dart-review.googlesource.com/19567
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
This commit is contained in:
Erik Ernst
2017-11-10 11:08:17 +00:00
committed by commit-bot@chromium.org
parent 1bcea20ed0
commit 57d00dfcb2
+1 -6
View File
@@ -1213,12 +1213,7 @@ optionalPositionalParameterTypes
;
namedParameterTypes
: LBRACE namedParameterType (',' namedParameterType)* ','? RBRACE
;
namedParameterType
: typedIdentifier
| identifier
: LBRACE typedIdentifier (',' typedIdentifier)* ','? RBRACE
;
typedIdentifier