From 865ea44a1f18ca88c0f9d93cfacd3178470a41ae Mon Sep 17 00:00:00 2001 From: jackdotink Date: Mon, 15 Jul 2024 15:21:43 -0500 Subject: [PATCH] add test --- tests/Parser.test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Parser.test.cpp b/tests/Parser.test.cpp index 972d0edd..12989230 100644 --- a/tests/Parser.test.cpp +++ b/tests/Parser.test.cpp @@ -20,6 +20,7 @@ LUAU_FASTFLAG(LuauAttributeSyntax); LUAU_FASTFLAG(LuauLeadingBarAndAmpersand2); LUAU_FASTFLAG(LuauAttributeSyntaxFunExpr); LUAU_FASTFLAG(LuauDeclarationExtraPropData); +LUAU_FASTFLAG(LuauDisallowVariadicInReturnParenType); namespace { @@ -3565,5 +3566,11 @@ TEST_CASE_FIXTURE(Fixture, "mixed_leading_intersection_and_union_not_allowed") matchParseError("type A = | number & string & boolean", "Mixing union and intersection types is not allowed; consider wrapping in parentheses."); } +TEXT_CASE_FIXTURE(Fixture, "do_not_parse_variadic_type_in_paren_type_in_returns") +{ + ScopedFastFlag sff{FFlag::LuauDisallowVariadicInReturnParenType, true}; + + matchParseError("local function f(): (number, ...string) | boolean end", "Expected identifier when parsing expression, got '|'"); +} TEST_SUITE_END();