mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
add test for mixed intersection and union
This commit is contained in:
parent
0f65b41459
commit
15d7810dee
1 changed files with 7 additions and 0 deletions
|
@ -3182,4 +3182,11 @@ TEST_CASE_FIXTURE(Fixture, "can_parse_leading_ampersand_intersections_successful
|
||||||
parse(R"(type A = & { string } & { number })");
|
parse(R"(type A = & { string } & { number })");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE_FIXTURE(Fixture, "mixed_leading_intersection_and_union_not_allowed")
|
||||||
|
{
|
||||||
|
ScopedFastFlag sff{FFlag::LuauLeadingBarAndAmpersand, true};
|
||||||
|
|
||||||
|
matchParseError("type A = & number | string | boolean", "Mixing union and intersection types is not allowed; consider wrapping in parentheses.");
|
||||||
|
}
|
||||||
|
|
||||||
TEST_SUITE_END();
|
TEST_SUITE_END();
|
||||||
|
|
Loading…
Add table
Reference in a new issue