@@ -8863,12 +8863,13 @@ Parser::parseDeclOperatorImpl(SourceLoc OperatorLoc, Identifier Name,
8863
8863
return makeParserCodeCompletionResult<OperatorDecl>();
8864
8864
}
8865
8865
8866
- SyntaxParsingContext ListCtxt (SyntaxContext, SyntaxKind::IdentifierList);
8867
-
8868
8866
(void )parseIdentifier (groupName, groupLoc,
8869
8867
diag::operator_decl_expected_precedencegroup,
8870
8868
/* diagnoseDollarPrefix=*/ false );
8871
8869
8870
+ SyntaxParsingContext ListCtxt (SyntaxContext,
8871
+ SyntaxKind::DesignatedTypeList);
8872
+
8872
8873
if (Context.TypeCheckerOpts .EnableOperatorDesignatedTypes ) {
8873
8874
// Designated types have been removed; consume the list (mainly for source
8874
8875
// compatibility with old swiftinterfaces) and emit a warning.
@@ -8885,9 +8886,17 @@ Parser::parseDeclOperatorImpl(SourceLoc OperatorLoc, Identifier Name,
8885
8886
typesEndLoc = groupLoc;
8886
8887
}
8887
8888
8888
- while (consumeIf (tok::comma, typesEndLoc)) {
8889
- if (Tok.isNot (tok::eof))
8889
+ while (Tok.isNot (tok::eof)) {
8890
+ SyntaxParsingContext ElementCtxt (SyntaxContext,
8891
+ SyntaxKind::DesignatedTypeElement);
8892
+ if (!consumeIf (tok::comma, typesEndLoc)) {
8893
+ ElementCtxt.setTransparent ();
8894
+ break ;
8895
+ }
8896
+
8897
+ if (Tok.isNot (tok::eof)) {
8890
8898
typesEndLoc = consumeToken ();
8899
+ }
8891
8900
}
8892
8901
8893
8902
if (typesEndLoc.isValid ())
0 commit comments