File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,8 @@ extension Parser.Lookahead {
350
350
// If the first name wasn't "isolated", we're done.
351
351
if !self . atContextualKeyword ( " isolated " ) &&
352
352
!self . atContextualKeyword ( " some " ) &&
353
- !self . atContextualKeyword ( " any " ) {
353
+ !self . atContextualKeyword ( " any " ) &&
354
+ !self . atContextualKeyword ( " each " ) {
354
355
return true
355
356
}
356
357
Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ extension Parser {
120
120
/// protocol-composition-continuation → type-identifier | protocol-composition-type
121
121
@_spi ( RawSyntax)
122
122
public mutating func parseSimpleOrCompositionType( ) -> RawTypeSyntax {
123
+ // 'each' is a contextual keyword for a pack reference.
124
+ if let each = consume ( ifAny: [ ] , contextualKeywords: [ " each " ] ) {
125
+ let packType = parseSimpleType ( )
126
+ return RawTypeSyntax ( RawPackReferenceTypeSyntax (
127
+ eachKeyword: each, packType: packType, arena: self . arena) )
128
+ }
129
+
123
130
let someOrAny = self . consume ( ifAny: [ ] , contextualKeywords: [ " some " , " any " ] )
124
131
125
132
var base = self . parseSimpleType ( )
You can’t perform that action at this time.
0 commit comments