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 {
350350 // If the first name wasn't "isolated", we're done.
351351 if !self . atContextualKeyword ( " isolated " ) &&
352352 !self . atContextualKeyword ( " some " ) &&
353- !self . atContextualKeyword ( " any " ) {
353+ !self . atContextualKeyword ( " any " ) &&
354+ !self . atContextualKeyword ( " each " ) {
354355 return true
355356 }
356357
Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ extension Parser {
120120 /// protocol-composition-continuation → type-identifier | protocol-composition-type
121121 @_spi ( RawSyntax)
122122 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+
123130 let someOrAny = self . consume ( ifAny: [ ] , contextualKeywords: [ " some " , " any " ] )
124131
125132 var base = self . parseSimpleType ( )
You can’t perform that action at this time.
0 commit comments