mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-16 06:45:44 +08:00
Update Parser.cpp
This commit is contained in:
parent
6bfc38e61a
commit
eae5989abb
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user