Skip to content

Commit

Permalink
Added metadata to new function type syntax parameter specifications
Browse files Browse the repository at this point in the history
In #30732 the concern was raised
that the new Function type syntax does not support metadata on
parameter specifications (i.e., on normalParameterTypes and on
namedParameterTypes).

The implication of adding support for metadata in these locations is
that `@required` can be used on function types, which is the motivation
for submitting 30732.

We have always had support on parameter declarations in function typed
parameter declarations (`void foo(@A() int f(@A() String s))`), so in
this sense there is no new semantics to worry about (Lasse: "it doesn't
mean anything anyway!").

This CL modifies the generic-function-type-alias.md informal spec to
include this kind of metadata support.

Change-Id: I4520d330458242b31c991f62c03ca2f34f9c5e54
Reviewed-on: https://dart-review.googlesource.com/5762
Commit-Queue: Erik Ernst <[email protected]>
Reviewed-by: Bob Nystrom <[email protected]>
Reviewed-by: Lasse R.H. Nielsen <[email protected]>
  • Loading branch information
eernstg authored and [email protected] committed Sep 18, 2017
1 parent adb0e88 commit c15eed1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/language/informal/generic-function-type-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ parameterTypeList: // NEW
normalParameterTypes: // NEW
normalParameterType (',' normalParameterType)*
normalParameterType: // NEW
type | typedIdentifier
metadata (type | typedIdentifier)
optionalParameterTypes: // NEW
optionalPositionalParameterTypes | namedParameterTypes
optionalPositionalParameterTypes: // NEW
'[' normalParameterTypes ','? ']'
namedParameterTypes: // NEW
'{' typedIdentifier (',' typedIdentifier)* ','? '}'
'{' namedParameterType (',' namedParameterType)* ','? '}'
namedParameterType: // NEW
metadata typedIdentifier
typedIdentifier: // NEW
type identifier
type: // CHANGED
Expand Down

0 comments on commit c15eed1

Please sign in to comment.