Update Parser.cpp

This commit is contained in:
Jack 2024-07-10 19:07:29 -05:00 committed by GitHub
parent 6bfc38e61a
commit eae5989abb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1463,7 +1463,7 @@ std::pair<Location, AstTypeList> Parser::parseReturnType()
if (lexer.current().type != Lexeme::SkinnyArrow && resultNames.empty()) if (lexer.current().type != Lexeme::SkinnyArrow && resultNames.empty())
{ {
// If it turns out that it's just '(A)', it's possible that there are unions/intersections to follow, so fold over it. // If it turns out that it's just '(A)', it's possible that there are unions/intersections to follow, so fold over it.
if (result.size() == 1) if (result.size() == 1 && !varargAnnotation)
{ {
AstType* returnType = parseTypeSuffix(result[0], innerBegin); AstType* returnType = parseTypeSuffix(result[0], innerBegin);