Skip to content

Commit c15eed1

Browse files
eernstgcommit-bot@chromium.org
authored andcommitted
Added metadata to new function type syntax parameter specifications
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]>
1 parent adb0e88 commit c15eed1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/language/informal/generic-function-type-alias.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,15 @@ parameterTypeList: // NEW
132132
normalParameterTypes: // NEW
133133
normalParameterType (',' normalParameterType)*
134134
normalParameterType: // NEW
135-
type | typedIdentifier
135+
metadata (type | typedIdentifier)
136136
optionalParameterTypes: // NEW
137137
optionalPositionalParameterTypes | namedParameterTypes
138138
optionalPositionalParameterTypes: // NEW
139139
'[' normalParameterTypes ','? ']'
140140
namedParameterTypes: // NEW
141-
'{' typedIdentifier (',' typedIdentifier)* ','? '}'
141+
'{' namedParameterType (',' namedParameterType)* ','? '}'
142+
namedParameterType: // NEW
143+
metadata typedIdentifier
142144
typedIdentifier: // NEW
143145
type identifier
144146
type: // CHANGED

0 commit comments

Comments
 (0)